Jump to content

edouard.p

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by edouard.p

  1. Thanks for your help. It seems that my problem solve itself, I deleted the specific price and created it again and it works fine now... very strange... Anyway, thanks again for your time !
  2. Hi Davidell, I do have the same problem (with different currencies). Could you please explain how did you solve that issue ? Thank a lot
  3. Bonjour à tous, Ma boutique est disponible dans plusieurs pays, et ma devise par défaut est l'EUR. Depuis le backoffice, je saisis tous mes prix en EUR et dans les pays étrangers les prix s'affiche automatiquement en USD en suivant le taux actuel. Pour certain produit, j'aimerai pouvoir saisir directement le prix en USD et que les prix en EUR soit calculés avec le taux, en gros je souhaite changer la devise par défaut pour certain produit uniquement. Est-ce possible ? Merci !
  4. Hi all, I'm pretty new to Prestashop. One of my client recently asked me to have a look on bugs on a Prestashop (1.5.5.0) website, so I'm trying to understand how it works. On of the bugs is: when a cart rule is applied to the cart, no others can be applied in addition, as a result only on cart rule can be applied. Even if all cart rules have been set to be compatible with all others. So I analysed Prestashop code to understand the mechanism of adding a cart rule to the cart, and there is a line a can't understand in addCartRule() from Cart class (Cart.php). public function addCartRule($id_cart_rule) { // You can't add a cart rule that does not exist $cartRule = new CartRule($id_cart_rule, Context::getContext()->language->id); if (!Validate::isLoadedObject($cartRule)) return false; if (Db::getInstance()->getValue('SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$this->id)) return false; // Add the cart rule to the cart if (!Db::getInstance()->insert('cart_cart_rule', array( 'id_cart_rule' => (int)$id_cart_rule, 'id_cart' => (int)$this->id ))) return false; Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_ALL); Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_SHIPPING); Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_REDUCTION); Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_GIFT); if ((int)$cartRule->gift_product) $this->updateQty(1, $cartRule->gift_product, $cartRule->gift_product_attribute, false, 'up', 0, null, false); return true; } To me this line: if (Db::getInstance()->getValue('SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$this->id)) return false; checks if there is already a rule for the current cart. But it doesn't check if the current rule is already applied, it just return false if there is already a rule for this cart. Am I wrong ? So, to me, as a result, if there is already a rule applied to this cart, no others can be added because these lines will return false every time. I understand that the idea here is to avoid to add a rule which is already applied to the cart, but I think a condition like 'AND id_cart_rule = ' . (int) $id_cart_rule is missing. Of course I might be completely wrong as I still new to Prestashop, that's why I would much appreciate some explaination about these lines. I'm also sorry to ask question about core code of an outdated version... Thanks a lot guys ! Edouard
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More