Jump to content


New Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About oisiaoeh

  • Rank
  1. OMG, you are a lifesaver, you are right, i simply find and replace without realising that the next if statement was a different variable. $new_qty = (int)$result['quantity'] + (int)$quantity; if ($quantity > 1 && ($id_product ==618 || $id_product ==888)) variable in bold shoud be $new_qty now everything is working fine as per normal ! Thank you all of you guys, really really appreciate your help !!
  2. before this when i am just limiting the quantity to 1 product id, there will be a error message shown in checkout page telling me to change the quantity and does not allow me to add more than 1 to the quantity, therefore i know it is working. after editing the above code, i no longer get the error message and i can add more than 1 quantity to both items when checkout.
  3. if ((int)$quantity <= 0) { return $this->deleteProduct($id_product, $id_product_attribute, (int)$id_customization, 0, $auto_add_cart_rule); } elseif (!$product->available_for_order || (Configuration::get('PS_CATALOG_MODE') && !defined('_PS_ADMIN_DIR_'))) { return false; } elseif ($quantity > 1 && ($id_product ==618 || $id_product ==888)) { // For example, 4 max per same product/product-combination allowed return false; } else { /* Check if the product is already in the cart */ $result = $this-&
  4. Done both and it is still not working, i even tried changing to other product id just in case it is the product attribute that is causing this problem.
  5. but mean while what is incorrect with the above statement? i am able to add more than 1 quantity for both the product ids
  6. I wanted to limit purchase of product id 618 to 1 so i added this statement. if ($quantity > 1 && $id_product =='618') Now i have another item which i want to limit the max quantity purchase so i changed the code to if ($quantity > 1 && ($id_product =='618' or $id_product =='625')) Now this is not working Can any one help me to check this or should there be a better way to write this code if there is a need to add more products next time, by the way this is code from prestashop and product id 625 has multiple attributes (not sure if that is the problem).
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.