Jump to content

Bug déclinaison de produit


Recommended Posts

Bonjour,

 

J'essaie de mettre en place des déclinaison de produits sur une boutique.

 

L'ajout au panier se fait en ajax via la fichier /modules/blockcart/ajax-cart.js.

 

Dans ce fichier, il y a une vérification de la quantifié du produit avant l'ajout.

 

Cette vérification se fait via la fonction Attribute::getAttributeMinimalQty($id_product_attribute) :

 

/**
 * Get minimal quantity for product with attributes quantity
 *
 * @acces public static
 * @param integer $id_product_attribute
 * @return mixed Minimal Quantity or false
 */
public static function getAttributeMinimalQty($id_product_attribute)
{
 $minimal_quantity = Db::getInstance()->getValue('
 SELECT `minimal_quantity`
 FROM `'._DB_PREFIX_.'product_attribute`
 WHERE `id_product_attribute` = '.(int)($id_product_attribute));

 if ($minimal_quantity > 1)
  return (int)$minimal_quantity;
 return false;
}

 

Voici la ligne qui me pose problème :

 

if ($minimal_quantity > 1)
  return (int)$minimal_quantity;

 

Est ce que ça ne devrait pas être

 

if ($minimal_quantity >= 1)
  return (int)$minimal_quantity;

 

à la place ?

 

Car j'ai des déclinaisons pour lesquelles le champs quantité minimale est égal à 1, et lorsque je clique sur le bouton "ajouter au panier" j'obtien le message d'erreur suivant :

 

"You already have the maximum quantity available for this product."

 

déclenché dans le fichier controller/Cartcontroller.php

 

Est-ce que quelqu'un peut m'expliquer pourquoi la condition est ">1" et non pas ">=1" ?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...