probier's mal so:
$col = 0;
while ($products_options = xtc_db_fetch_array($products_options_query,true)) {
ersetzen mit:
$products_options_data[$row]['DATA'][0] = array ('ID' => 0, 'TEXT' => PULL_DOWN_DEFAULT
);$col = 1;while ($products_options = xtc_db_fetch_array
($products_options_query,true)) {
Boah... Du bist echt Super-Klasse!
Vielen vielen Dank für Deine Hilfe!
Habe es jetzt endlich hinbekommen.
Jetzt hab ich auch verstanden was Du dort gemacht hast.
Also hier noch einmal für alle die eine [Lagerampel + Bitte wählen] Variante in Ihrem Shop einbauen möchten einmal hier aufpassen.
Es müssen 2 Dateien angepasst werden.
>>> includes/modules/product_attributes.php
>>> templates/DEINTEMPLATE/module/product_option/product_options_dropdown.html
---
>>> product_attributes.php
Ca. ab Zeile 42 kommt dieser Block
$products_options_query = xtDBquery("select pov.products_options_values_id,
pov.products_options_values_name,
pa.attributes_model,
pa.options_values_price,
pa.price_prefix,
pa.attributes_model
from ".TABLE_PRODUCTS_ATTRIBUTES." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES." pov
where pa.products_id = '".$product->data['products_id']."'
and pa.options_id = '".$products_options_name['products_options_id']."'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '".(int) $_SESSION['languages_id']."'
order by pa.sortorder");
Dort müsst Ihr einfach ein "pa.attributes_stock," zwischen den Werten "pa.price_prefix," und "pa.attributes_model" einfügen!
Ca. ab Zeile 57
$col = 0;
while ($products_options = xtc_db_fetch_array($products_options_query,true)) {
ersetzen mit
// Bitte Wählen anzeigen im Dropdown//$col = 0;//while ($products_options = xtc_db_fetch_array($products_options_query,true)) {$products_options_data[$row]['DATA'][0] = array ('ID' => 0, 'TEXT' => PULL_DOWN_DEFAULT
, 'STOCK' => 999999);$col = 1;while ($products_options = xtc_db_fetch_array
($products_options_query,true)) {// Bitte Wählen anzeigen im Dropdown Die 999999 ermöglicht in meinem Fall die "nicht" Anzeige eines "Bitte wählen <<Zuzeit ausverkauft". Das bedeutet wenn der Lagerwert des Attributes über 999999 liegt dann wird kein Lagerampel-Hinweis ausgegeben und es steht dann nur noch "Bitte wählen" in dem Dropdown.
Wichtig wenn Ihr Artikel mit Attributen habt von denen mehr als 999999 auf Lager sind. Erhöht diesen Wert dann einfach so hoch, dass ihr da keine Probleme bekommt. In meinem Fall reicht dies auf jedenfall!
Nun kommen wir noch zu der Ampel:
Immernoch die Datei
>>> product_attributes.php ca. Zeile 66
'PRICE' => '', 'FULL_PRICE' => '', 'PREFIX' => $products_options['price_prefix']);
} else {
davor einfügen
// Lagerampel
'STOCK' => $products_options['attributes_stock'],
// Lagerampel
das gleiche macht Ihr noch einmal bei ca. bei Zeile 85
'PRICE' => $xtPrice->xtcFormat($price, true), 'FULL_PRICE' => $xtPrice->xtcFormat($full, true), 'PREFIX' => $products_options['price_prefix']);//if PRICE for option is 0 we don't need to display itif ($price == 0) {unset ($products_options_data[$row]['DATA'][$col]['PRICE']); davor einfügen
// Lagerampel
'STOCK' => $products_options['attributes_stock'],
// Lagerampel
Jetzt sind wir mit der ersten Datei fertig!
Nun zur zweiten Datei
>>> product_options_dropdown.html
Hier poste ich einfach den kompletten Inhalt. Vielleicht nennt Ihr die Datei mit dem neuen Inhalt einfach product_options_NEW_dropdown.html
{config_load
file="$language/lang_$language.conf" section
="product_info"}{if $options!=''}<table width
="80%" border
="0" cellspacing
="0" cellpadding
="0"> {foreach name
=outer item
=options_data from
=$options} <tr
> <tr
> <td
class="main"><b
>Verfügbare
{$options_data.NAME
}:</b
> </td
> </tr
> <td
> <select name
="id[{$options_data.ID}]"> {foreach key=key_data item
=item_data from
=$options_data.DATA
} <option style
="min-width:95px;" value
="{$item_data.ID}">{$item_data.TEXT
} {if $item_data.PRICE
!='' }{$item_data.PREFIX
}{$item_data.PRICE
}{/if}{if $item_data.STOCK
<='0' }« Zurzeit Ausverkauft
{elseif $item_data.STOCK
<='999998' }« Artikel auf Lager
!{/if} </option
> {/foreach} </select
> </td
> </tr
> {/foreach}</table
>{/if} Der Vorteil dieser Anzeige ist Ihr könnt mehrere Ausgaben verwirklichen.
{if $item_data.STOCK <='0' }« Zurzeit Ausverkauft
{elseif $item_data.STOCK <='999998' }« Artikel auf Lager!{/if}
Ändert das einfach so wie Ihr es haben möchtet.
Bei dem Beispiel wird jetzt bei Attributen mit Bestand NULL ein "Zurzeit Ausverkauft" angezeigt. Alle Attribute die darüber lieben aber unter 999999 werden mit "Artikel auf Lager!" gekennzeichnet.
Ich hoffe Ich habe damit etwas zurück geben können.
Falls es Fragen gibt einfach hier im Thread stellen. Ich werde versuchen zu helfen.
Lieben Gruß
Peril