Dans ma boutique je veux ajoute une restriction lorsque l item ajouté dans le panier si il est moins ou égal à 10$ et que la quantite est plus petite que 2 alors quantity = 2
mon probleme est que le prix final_price a droite est correct mais le sous-total $cart->show_total en bas n est pas calculé correctement il le calcule comme la quantité est de 1 par defaut comment faire pour refaire le calcul du sous_total automatiquement ... car quand je clique sur le bouton actualiser la mon sous total est correct du au post udpate_product.
Jai tenté d appeler les fonctions calculate() update_product() sans resultat concluant.
Voici mon code ligne 146 appro du Shopping_cart.php :
if ( ($products[$i]['quantity'] < 2) && ($products[$i]['final_price'] <= 10) )
{
$products[$i]['quantity'] = 2;
$info_box_contents[$cur_row][] = array('align' => 'center',
'params' => 'class="productListing-data" valign="top"',
'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));
}
else
{
$info_box_contents[$cur_row][] = array('align' => 'center',
'params' => 'class="productListing-data" valign="top"',
'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));
}
// fin de la modification
$info_box_contents[$cur_row][] = array('align' => 'right',
'params' => 'class="productListing-data" valign="top"',
'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
}
new productListingBox($info_box_contents);
?>
</td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td align="right" class="main"><b>
<?php if (tep_session_is_registered('customer_id')){ echo SUB_TITLE_SUB_TOTAL; } ?>
<?php if (tep_session_is_registered('customer_id')){ echo $currencies->format($cart->show_total()); } ?></b></td>
merci de votre aide