Bonjour
Je me permet de relancer ce post car j'ai le même problème que ACréation, mais contrairement à lui même sur le serveur celà ne fonctionne pas , l'image qui s'affiche est toujours celle correspondant à un stock 0 .
Pour info voici le code que j'ai inséré
Code
$prod_quantity = tep_get_products_stock($products_id);
switch ($prod_quantity) {
case 0: // change this to a quantity you want - it's the for "available on request"
echo '<img src="images/icons/stock_nostock.gif" border="0" title="" alt="' . TEXT_PRODUIT_EN_STOCK . '">';
break;
case 1: // change this to a quantity you want - it's the number for "available within 10 workdays"
echo '<img src="images/icons/stock_instock.gif" border="0" title="" alt="' . TEXT_PRODUIT_EN_STOCK . '">';
break;
default: //if the quantity is not 1 or 0, this text will be shown.
echo '<img src="images/icons/stock_instock.gif" border="0" title="" alt="' . TEXT_PRODUIT_EN_STOCK . '">';
}
J'ai aussi essayé ca :
Code
$prod_quantity = tep_get_products_stock($products_id);
if ($prod_quantity == 0) {
echo '<img src="images/icons/stock_nostock.gif" border="0" title="" alt="' . TEXT_PRODUIT_EN_STOCK . '"> ';
} elseif ($prod_quantity >= 1) {
echo '<img src="images/icons/stock_instock.gif" border="0" title="" alt="' . TEXT_PRODUIT_EN_STOCK . '">';
Rien n'y fait !!! J'ai l'impression que le problème viens de la fonction tep_get_products_stock($products_id) , mais je ne trouve pas de solution.
Si quelqu'un à une piste , merci d'avance .