{"id":149,"date":"2014-11-24T04:26:21","date_gmt":"2014-11-24T04:26:21","guid":{"rendered":"http:\/\/angelwings.net\/blog\/?p=149"},"modified":"2014-11-24T04:26:21","modified_gmt":"2014-11-24T04:26:21","slug":"prestashop-category-quantity-discount","status":"publish","type":"post","link":"https:\/\/angelwings.net\/blog\/prestashop-category-quantity-discount\/","title":{"rendered":"Prestashop: Category Quantity Discount"},"content":{"rendered":"<p>Apply Quantity Discounts across all products in a category<br \/>\nPrestashop 1.2 &#8211; 1.3 Source: http:\/\/www.prestashop.com\/forums\/topic\/75558-mod-quantity-discounts-for-all-the-products-in-the-same-default-category\/<br \/>\nPrestashop 1.4 &#8211; 1.6 Source: http:\/\/www.prestashop.com\/forums\/topic\/140803-free-module-category-quantity-discount-apply-quantity-discounts-across-all-products-in-a-category\/<\/p>\n<p>Quantity discount is calculated based on the price of product. For promotion mechanics below, if we use the built-in sale price function for 1 product, the quantity discount will be calculated based on the discounted price of 1 product.<br \/>\nPurchase 1 items 10% off<br \/>\nPurchase 2 items 15% off<br \/>\nPurchase 3 items 20 % off<br \/>\nPurchase 4 items 25 % off<br \/>\nPurchase 5 items 30% off<br \/>\nPurchase 6 items 35% off<\/p>\n<p>So we disable the admin check for minimum more than 1 quantity in order to allow creating quantity discount % for purchase of 1 product.<br \/>\nchange: admin\/tabs\/AdminProducts.php<\/p>\n<blockquote><p>elseif (!($quantity_discount = intval(Tools::getValue(&#8216;quantity_discount&#8217;))) OR $quantity_discount <= 1)\n$this->_errors[] = Tools::displayError(&#8216;quantity is required and must be superior of 1&#8217;);<\/p><\/blockquote>\n<p>to<\/p>\n<blockquote><p>elseif (!($quantity_discount = intval(Tools::getValue(&#8216;quantity_discount&#8217;))) OR $quantity_discount <= 0)\n$this->_errors[] = Tools::displayError(&#8216;quantity is required and must be superior of 0&#8217;);<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Apply Quantity Discounts across all products in a category Prestashop 1.2 &#8211; 1.3 Source: http:\/\/www.prestashop.com\/forums\/topic\/75558-mod-quantity-discounts-for-all-the-products-in-the-same-default-category\/ Prestashop 1.4 &#8211; 1.6 Source: http:\/\/www.prestashop.com\/forums\/topic\/140803-free-module-category-quantity-discount-apply-quantity-discounts-across-all-products-in-a-category\/ Quantity discount is calculated based on the price of product. For promotion mechanics below, if we use the built-in sale price function for 1 product, the quantity discount will be calculated based on the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[103,104],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-ecommerce","tag-prestashop","tag-prestashop-1-3"],"_links":{"self":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/comments?post=149"}],"version-history":[{"count":0,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"wp:attachment":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/media?parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}