prova così:
nella tabella configuration aggiungi queste righe:
Codice: Seleziona tutto
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Usa immagine semaforo', 'TRAFFIC_LIGHT', 'true', 'Use Traffic light for visualize image to QTY - select True to use Traffic light, select False to visualize QTY (original oscommerce).', 20, 32, NULL, '2007-05-07 09:14:59', NULL, 'tep_cfg_select_option(array(''true'', ''false''), '),
('Quantità per semaforo GIALLO', 'TRAFFIC_LIGHT_YELLOW', '1', 'Quantità MINIMA per semaforo GIALLO (OBBLIGATORIO =1). Se settato a >1 non va!', 20, 33, '2007-05-10 16:04:44', '2007-05-07 09:14:59', NULL, NULL),
('Quantità per semaforo VERDE', 'TRAFFIC_LIGHT_GREEN', '10', 'QTY MINIMA per semaforo VERDE (default 10).', 20, 34, NULL, '2007-05-07 09:14:59', NULL, NULL);
Codice: Seleziona tutto
<?php
// image for QTY
if ( TRAFFIC_LIGHT == 'true') {
if (PRODUCT_LIST_QUANTITY != NULL) {
$prod_quantity = $product_info['products_quantity'];
$minus = ($prod_quantity <= 0);
$red = ($prod_quantity == NULL);
$yellow = (($prod_quantity >= TRAFFIC_LIGHT_YELLOW) && ($prod_quantity <= TRAFFIC_LIGHT_GREEN));
$green = ($prod_quantity > TRAFFIC_LIGHT_GREEN );
switch ($prod_quantity) {
case $minus:
$img = tep_image(bts_select(images, 'icon_status_red.png'), TEXT_NOT_AVAIBLE) . ' ' . TEXT_NOT_AVAIBLE ;
break;
case $red:
$img = tep_image(bts_select(images, 'icon_status_red.png'), TEXT_NOT_AVAIBLE) . ' ' . TEXT_NOT_AVAIBLE ;
break;
case $yellow :
$img = tep_image(bts_select(images, 'icon_status_yellow.png'), TEXT_FEW_QTY) . ' ' . TEXT_FEW_QTY ;
break;
case $green :
$img = tep_image(bts_select(images, 'icon_status_green.png'), TEXT_BIG_QTY) . ' ' . TEXT_BIG_QTY ;
break;
}
echo TEXT_IN_STOCK . ' ' . $img ;
}
}
// image for QTY END
?>
Codice: Seleziona tutto
// image for QTY
if ( TRAFFIC_LIGHT == 'false') {
$lc_text = '<br /> ' . $listing['products_quantity'] . ' <br /><br />';
} else {
$prod_quantity = $listing['products_quantity'];
$minus = ($prod_quantity <= 0);
$red = ($prod_quantity == NULL);
$yellow = (($prod_quantity >= TRAFFIC_LIGHT_YELLOW) && ($prod_quantity <= TRAFFIC_LIGHT_GREEN));
$green = ($prod_quantity > TRAFFIC_LIGHT_GREEN );
switch ($prod_quantity) {
case $minus:
$img = tep_image(bts_select(images, 'icon_status_red.png'), TEXT_NOT_AVAIBLE) . ' ' . TEXT_NOT_AVAIBLE ;
break;
case $red:
$img = tep_image(bts_select(images, 'icon_status_red.png'), TEXT_NOT_AVAIBLE) . ' ' . TEXT_NOT_AVAIBLE ;
break;
case $yellow :
$img = tep_image(bts_select(images, 'icon_status_yellow.png'), TEXT_FEW_QTY) . ' ' . TEXT_FEW_QTY ;
break;
case $green :
$img = tep_image(bts_select(images, 'icon_status_green.png'), TEXT_BIG_QTY) . ' ' . TEXT_BIG_QTY ;
break;
}
$lc_text = $img ;
}
// image for QTY END
Codice: Seleziona tutto
// image for QTY
if ( TRAFFIC_LIGHT == 'false') {
$lc_text = '<br /> ' . $listing['products_quantity'] . ' <br /><br />';
} else {
$prod_quantity = $listing['products_quantity'];
$minus = ($prod_quantity <= 0);
$red = ($prod_quantity == NULL);
$yellow = (($prod_quantity >= TRAFFIC_LIGHT_YELLOW) && ($prod_quantity <= TRAFFIC_LIGHT_GREEN));
$green = ($prod_quantity > TRAFFIC_LIGHT_GREEN );
switch ($prod_quantity) {
case $minus:
$img = tep_image(bts_select(images, 'icon_status_red.png'), TEXT_NOT_AVAIBLE) . ' ' . TEXT_NOT_AVAIBLE ;
break;
case $red:
$img = tep_image(bts_select(images, 'icon_status_red.png'), TEXT_NOT_AVAIBLE) . ' ' . TEXT_NOT_AVAIBLE ;
break;
case $yellow :
$img = tep_image(bts_select(images, 'icon_status_yellow.png'), TEXT_FEW_QTY) . ' ' . TEXT_FEW_QTY ;
break;
case $green :
$img = tep_image(bts_select(images, 'icon_status_green.png'), TEXT_BIG_QTY) . ' ' . TEXT_BIG_QTY ;
break;
}
$lc_text = $img ;
}
// image for QTY END
Penso che dovrebbe bastare...
Michela