Re: Quantity Discounts for 1.3
1.5.7
PHP 7.3.21
MySQL 5.7.31
OPC
News Box Manager
Sitemap XML
Quick Updates
Edit Orders
Base Item Price =$5 Looking to have the following for the category so that the discount is for any Suncatcher (ID #27)
Attachment 19151
In ot_quantity_discount.php, set to
Code:
// Add categories with special discounting policies to this list. // Note that 99999, 99998 and 99997 are just given as examples.
// Note that the Discounting Units you specified in Admin
// (percentage, currency, currency/item) are also used here.
function apply_special_category_discount($category, $count, &$disc_amount) {
switch ($category) {
case 27:
if ($count > 2) {
$disc_amount = 4.5000;
}
if ($count > 5) {
$disc_amount = 4.2500;
}
if ($count > 8) {
$disc_amount = 4.0000;
}
break;
}
}
Settings in admin are
Attachment 19152
Discounts do not appear.
Could it be that I have all items by theme using the multilink?
Re: Quantity Discounts for 1.3
When you say "discounts do not appear" you mean they don't show up on the checkout payment page?
If so, the issue is that the products in question do not have a master category id of 27. Check your database.
Re: Quantity Discounts for 1.3
All items are master ID 27
I see now that the discount is showing (incorrectly) at checkout. I was hoping it would give the chart as shown in the first image rather than wait to show up at the "last minute".
Also, the settings do not reflect unit cost. e.g., any combination of suncatchers, $5 base price, add 12 to the cart. I need the price to drop to $4 each. With the current settings, the result is not $4 each but a $4 total discount.
Re: Quantity Discounts for 1.3
The chart you are showing is from the native Quantity Discounts feature, not my Quantity Discounts plugin.
You can build something similar - look at the help on my site for Quantity Discounts, and search for "Marketing Text." You can also get Discount Preview to show the discount in the cart.
As for the calculation, you would have to multiply the $count variable by the unit price reduction to get the discount you want.
if ($count > 8) {
$disc_amount = 1 * $count;
}
etc.
Re: Quantity Discounts for 1.3
Getting the following warning!
[20-Nov-2020 16:28:05 America/Chicago] PHP Warning: Use of undefined constant MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_TITLE - assumed 'MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_TITLE' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 89
[20-Nov-2020 16:28:05 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 204.95.11.126
#1 ot_quantity_discount->__construct() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:5]
#2 include_once(/home/haremark/public_html/includes/modules/haredo/inc_qd.php) called at [/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php:175]
#3 require(/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php) called at [/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php:171]
#4 require(/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php) called at [/home/haremark/public_html/index.php:97]
[20-Nov-2020 16:28:05 America/Chicago] PHP Warning: Use of undefined constant MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_DESCRIPTION - assumed 'MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_DESCRIPTION' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 90
[20-Nov-2020 16:28:05 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 204.95.11.126
#1 ot_quantity_discount->calculate_deductions() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:7]
[20-Nov-2020 16:28:05 America/Chicago] PHP Warning: Use of undefined constant YOUR_CURRENT_QUANTITY_DISCOUNT - assumed 'YOUR_CURRENT_QUANTITY_DISCOUNT' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 238
[20-Nov-2020 16:28:05 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 204.95.11.126
#1 ot_quantity_discount->calculate_deductions() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:7]
[20-Nov-2020 16:28:05 America/Chicago] PHP Warning: Use of undefined constant PER_ITEM_OFF - assumed 'PER_ITEM_OFF' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 345
[20-Nov-2020 16:28:05 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 204.95.11.126
#1 ot_quantity_discount->calculate_deductions() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:7]
[20-Nov-2020 16:28:05 America/Chicago] PHP Warning: Use of undefined constant ITEMS - assumed 'ITEMS' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 345
[20-Nov-2020 16:28:05 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 204.95.11.126
#1 ot_quantity_discount->calculate_deductions() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:7]
[20-Nov-2020 16:28:05 America/Chicago] PHP Warning: Use of undefined constant TOTAL_DISCOUNT - assumed 'TOTAL_DISCOUNT' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 352
Re: Quantity Discounts for 1.3
You are running old copies of Quantity Discounts and/or Discount Preview. You need to update both.
Re: Quantity Discounts for 1.3
Quantity Discount: running latest Zen CartŪ Versions v1.5.4, v1.5.5, v1.5.6, v1.5.7
Preview subtotal: Paid module, Version 1.13
Zen Cart Version: 156c
PHP Version: 7.2.34 (Zend: 3.2.0)
Getting the following Warning below:
PHP Code:
[20-Nov-2020 23:04:26 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 216.177.186.199
#1 ot_quantity_discount->__construct() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:5]
#2 include_once(/home/haremark/public_html/includes/modules/haredo/inc_qd.php) called at [/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php:175]
#3 require(/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php) called at [/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php:171]
#4 require(/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php) called at [/home/haremark/public_html/index.php:97]
[20-Nov-2020 23:04:26 America/Chicago] PHP Warning: Use of undefined constant MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_TITLE - assumed 'MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_TITLE' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 89
[20-Nov-2020 23:04:26 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 216.177.186.199
#1 ot_quantity_discount->__construct() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:5]
#2 include_once(/home/haremark/public_html/includes/modules/haredo/inc_qd.php) called at [/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php:175]
#3 require(/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php) called at [/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php:171]
#4 require(/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php) called at [/home/haremark/public_html/index.php:97]
[20-Nov-2020 23:04:26 America/Chicago] PHP Warning: Use of undefined constant MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_DESCRIPTION - assumed 'MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_DESCRIPTION' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 90
[20-Nov-2020 23:04:26 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 216.177.186.199
#1 ot_quantity_discount->calculate_deductions() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:7]
#2 include_once(/home/haremark/public_html/includes/modules/haredo/inc_qd.php) called at [/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php:175]
#3 require(/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php) called at [/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php:171]
#4 require(/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php) called at [/home/haremark/public_html/index.php:97]
[20-Nov-2020 23:04:26 America/Chicago] PHP Warning: Use of undefined constant YOUR_CURRENT_QUANTITY_DISCOUNT - assumed 'YOUR_CURRENT_QUANTITY_DISCOUNT' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 238
[20-Nov-2020 23:04:26 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 216.177.186.199
#1 ot_quantity_discount->calculate_deductions() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:7]
#2 include_once(/home/haremark/public_html/includes/modules/haredo/inc_qd.php) called at [/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php:175]
#3 require(/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php) called at [/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php:171]
#4 require(/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php) called at [/home/haremark/public_html/index.php:97]
[20-Nov-2020 23:04:26 America/Chicago] PHP Warning: Use of undefined constant PER_ITEM_OFF - assumed 'PER_ITEM_OFF' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 345
[20-Nov-2020 23:04:26 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 216.177.186.199
#1 ot_quantity_discount->calculate_deductions() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:7]
#2 include_once(/home/haremark/public_html/includes/modules/haredo/inc_qd.php) called at [/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php:175]
#3 require(/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php) called at [/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php:171]
#4 require(/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php) called at [/home/haremark/public_html/index.php:97]
[20-Nov-2020 23:04:26 America/Chicago] PHP Warning: Use of undefined constant ITEMS - assumed 'ITEMS' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 345
[20-Nov-2020 23:04:26 America/Chicago] Request URI: /index.php?main_page=shopping_cart, IP address: 216.177.186.199
#1 ot_quantity_discount->calculate_deductions() called at [/home/haremark/public_html/includes/modules/haredo/inc_qd.php:7]
#2 include_once(/home/haremark/public_html/includes/modules/haredo/inc_qd.php) called at [/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php:175]
#3 require(/home/haremark/public_html/includes/templates/haredo/templates/tpl_shopping_cart_default.php) called at [/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php:171]
#4 require(/home/haremark/public_html/includes/templates/haredo/common/tpl_main_page.php) called at [/home/haremark/public_html/index.php:97]
[20-Nov-2020 23:04:26 America/Chicago] PHP Warning: Use of undefined constant TOTAL_DISCOUNT - assumed 'TOTAL_DISCOUNT' (this will throw an Error in a future version of PHP) in /home/haremark/public_html/includes/modules/order_total/ot_quantity_discount.php on line 352
Re: Quantity Discounts for 1.3
All those constants are defined in ./includes/languages/english/modules/order_total/ot_quantity_discount.php.
- have you changed this file?
- have you created a new language and not copied in an updated version of this file?
Re: Quantity Discounts for 1.3
Thank you Scott,
The preview_subtotal was the FIX !!
Mark
Re: Quantity Discounts for 1.3
Hi Scott,
I have these errors in 157 using your updated plugin code and also after I compare the modifications for my site.
Can you help?
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined offset: 68 in /Users/macminiserver/Sites/websites/MC2020/includes/modules/order_total/ot_quantity_discount.php on line 207
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined offset: 68 in /Users/macminiserver/Sites/websites/MC2020/includes/modules/order_total/ot_quantity_discount.php on line 208
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined index: 11001649:caff8fa231126a9775e9fcbad8c09ab1 in /Users/macminiserver/Sites/websites/MC2020/includes/modules/order_total/ot_quantity_discount.php on line 212
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined index: 11001649:caff8fa231126a9775e9fcbad8c09ab1 in /Users/macminiserver/Sites/websites/MC2020/includes/modules/order_total/ot_quantity_discount.php on line 213
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined variable: ccnum in /Users/macminiserver/Sites/websites/MC2020/includes/modules/payment/paypaldp.php on line 330
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined variable: ccnum in /Users/macminiserver/Sites/websites/MC2020/includes/modules/payment/paypaldp.php on line 330
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined offset: 68 in /Users/macminiserver/Sites/websites/MC2020/includes/modules/order_total/ot_quantity_discount.php on line 207
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined offset: 68 in /Users/macminiserver/Sites/websites/MC2020/includes/modules/order_total/ot_quantity_discount.php on line 208
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined index: 11001649:caff8fa231126a9775e9fcbad8c09ab1 in /Users/macminiserver/Sites/websites/MC2020/includes/modules/order_total/ot_quantity_discount.php on line 212
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined index: 11001649:caff8fa231126a9775e9fcbad8c09ab1 in /Users/macminiserver/Sites/websites/MC2020/includes/modules/order_total/ot_quantity_discount.php on line 213
[01-Dec-2020 09:42:06 America/New_York] PHP Notice: Undefined variable: ccnum in /Users/macminiserver/Sites/websites/MC2020/includes/modules/payment/paypaldp.php on line 330