Antwort #6 am: 09. Dezember 2009, 20:30:37
Hi Torsten,
na dann wollen wir mal ... wie gesagt ... das ganze ist eigentlich von Gunnart
in die templates/xtc5/source/boxes.php
ganz am ende die folgene Funktion einfügen:
function OptionOnStock
($Nummer) { global $actual_products_id; $Query = xtDBquery
("
SELECT pa.attributes_stock
FROM ".TABLE_PRODUCTS_ATTRIBUTES
." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES
." pov
WHERE pa.products_id = '".$actual_products_id."'
AND pa.options_values_id = '".$Nummer."'
AND pa.options_values_id = pov.products_options_values_id
"); $Query = xtc_db_fetch_array
($Query,true); return intval($Query['attributes_stock']);} ich habe das ganze in das table_listing.html eingefügt ...
hier mal die komplette Datei ...
{if $options!=''}<table width
="100%" border
="0" cellpadding
="0" cellspacing
="0"> {foreach name
=outer item
=options_data from
=$options} <tr
> <td style
="border-bottom: 1px solid #cccccc;" colspan
="4"><strong
>{$options_data.NAME
}:</strong
></td
> </tr
> {php
} $count=0; {/php
} {foreach key=key_data item
=item_data from
=$options_data.DATA
} <tr
class="{cycle values="tableListingI
,tableListingII
"}"> <td style
="border-bottom: 1px dotted #cccccc;"> {php
} $count++; if ($count==1) { {/php
} <input type
="radio" name
="id[{$options_data.ID}]" value
="{$item_data.ID}" checked
="checked" /> {php
} } else { {/php
} <input type
="radio" name
="id[{$options_data.ID}]" value
="{$item_data.ID}" /> {php
} } {/php
} </td
> <td style
="border-bottom: 1px dotted #cccccc;">{$item_data.TEXT
}<br
/> ArtNr
.: {$item_data.MODEL
}</td
> <td style
="border-bottom: 1px dotted #cccccc;" align
="right">{php
}$artikelanzahl = OptionOnStock
($this->_tpl_vars
[item_data
][ID
]);if ($artikelanzahl>0 && $artikelanzahl<100 ){ echo '<a class="thickbox" title="Information" href="./popup_content.php?coID=34?KeepThis=true&;;TB_iframe=true&height=400&width=600" target="_blank"><img /></a>';}if ($artikelanzahl<1){ echo '<a class="thickbox" title="Information" href="./popup_content.php?coID=34?KeepThis=true&;;TB_iframe=true&height=400&width=600" target="_blank"><img /></a>';}if ($artikelanzahl>=100){ echo '<a class="thickbox" title="Information" href="./popup_content.php?coID=34?KeepThis=true&;;TB_iframe=true&height=400&width=600" target="_blank"><img /></a>';}{/php
} </td
> {if $item_data.PRICE
}<td align
="right" style
="border-bottom: 1px dotted #cccccc;">{$item_data.PREFIX
}{$item_data.PRICE
}</td
>{/if}</tr
> {/foreach} {/foreach}</table
>{/if} Die Grafiken ...
- lager_gruen2.gif
- lager_neutral2.gif
- lager_rot2.gif
erstellen und in den img Ordern vom Template hochladen.
Ich habe das ganze noch mit einem entsprechenden Popup ... wer das nicht benötigt kann ja den Link in den echos einfach rausnehmen oder aber die ID zur entsprechenden Contentseite anpassen.
Last but not least sollte man in der product_info.html noch die Lageranzeige für den Hauptartikel abschalten ... die macht da ja keinen Sinn.
Einfach um die bisherige Lageranzeige diese if-Abfrage packen ...
{if $MODULE_product_options ==''}
...
...
{/if}
Und das wars dann auch schon
Im Screenshot sieht man wie das ganze dann aussieht.
[ Für Gäste sind keine Dateianhänge sichtbar ]
Markus