Peha Posted May 6, 2010 Share Posted May 6, 2010 Bonjour,lorsqu'un voucher est cumulable, il l'est avec les autres vouchers mais aussi avec lui même.Si bien que si un client en a plusieurs, il peut les ajouter aux panier jusqu'à arriver a 0.Si il n'est pas cumulable on ne peut pas en ajouter plus d'1 par panier > ce qui est gênant dans le cas de vouchers limités à certaines catégories d'articles.je veux donc que ces bons puissent être cumulablesVOUCHER -30% sur catégorie AVOUCHER -25% sur catégorie BVOUCHER -36% sur catégorie Cmais qu'il soit impossible de faire ceci :VOUCHER -30% sur catégorie AVOUCHER -30% sur catégorie AVOUCHER -30% sur catégorie Atotal Du panier = 0|**|**| La solution |**|**|classes/Cart.php l:816remplacer foreach ($discounts as $discount) if (!$discount['cumulable']){ return Tools::displayError("previous voucher added isn\'t cumulative with other discounts"); } par foreach ($discounts as $discount){ if (!$discount['cumulable']){ return Tools::displayError("previous voucher added isn\'t cumulative with other discounts"); } else{ if($discountObj->name == $discount['name']){ return Tools::displayError("you cannot use this voucher anymore (usage limit attained)"); } } } Link to comment Share on other sites More sharing options...
berlingonic Posted May 6, 2010 Share Posted May 6, 2010 Bonjour,Je viens de faire le changement et j'ai ceci comme erreur : Parse error: syntax error, unexpected T_STRING in /var/www/cadrix.be/htdocs/boutique_pro/classes/Cart.php on line 826Ne te fache pas, mais suis pas trop calé dans ce domaine.Merci d'avanceNico Link to comment Share on other sites More sharing options...
Peha Posted May 6, 2010 Author Share Posted May 6, 2010 je cherche pkoi..peut être une erreur lors de la retranscription du forum..[édit]chez moi ça marche.- vérifie que tu n'as as emporté un } à la fin Link to comment Share on other sites More sharing options...
berlingonic Posted May 6, 2010 Share Posted May 6, 2010 non jen ai bien deux, j'ai trouvé une différence avec ceci :('you cannot use this voucher anymore (usage limit attained)); en général dans le site on trouve une virgule à la fin comme ceci :('you cannot use this voucher anymore (usage limit attained)'); et quand je change cela bien l'erreur se trouve en ligne 855.Alors je ne sais pas je vais encore essayer.Voici partie : if (!$discountObj->cumulable) return Tools::displayError('this voucher isn\'t cumulative with other current discounts'); foreach ($discounts as $discount) if (!$discount['cumulable']){ return Tools::displayError('previous voucher added isn\'t cumulative with other discounts'); } else{ if($discountObj->name == $discount['name']){ return Tools::displayError('you cannot use this voucher anymore (usage limit attained)); } } if (is_array($discounts) AND in_array($discountObj->id, $discounts)) return Tools::displayError('this voucher is already in your cart'); if ($discountObj->id_customer AND $this->id_customer != $discountObj->id_customer) { if (!$cookie->isLogged()) return Tools::displayError('you cannot use this voucher').' - '.Tools::displayError('try to log in if you own it'); return Tools::displayError('you cannot use this voucher'); } Link to comment Share on other sites More sharing options...
berlingonic Posted May 6, 2010 Share Posted May 6, 2010 RE, j'ai trouvé en effet j'ai oublié une } , mais il fallait bien aussi la virgule.Maintenant vais voir si cela marche et te remercie encore beaucoup.Nico Link to comment Share on other sites More sharing options...
berlingonic Posted May 6, 2010 Share Posted May 6, 2010 Ok tout va bien et encore merci première fois que j'ai une réponse qui m'aide.Encore merci pour tout ce que vous faite, c'est dommage que mon niveau informatique est très faible, car j'aiemrai comme vous pouvoir participer plus activement aux dévellopement j'adore mais pas le votre niveau.Mercia+Nico Link to comment Share on other sites More sharing options...
Peha Posted May 6, 2010 Author Share Posted May 6, 2010 c'est le forum qui enlève ce petit ' à cause du isn\'t je l'ai remplacé par "pour l'informatiqueça vient petit à petit... à force de bidouiller Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now