Found a bug in the latest Github version (https://github.com/lat9/edit_orders).
PHP Fatal error: Call to undefined function zen_product_in_category() in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 326
Category-restricted coupons were not adding into the total after editing the order. In addition to the bugfix found in post #495, I needed to do the following as well.
In this file:
admin/includes/functions/extra_functions/edit_orders_functions.php
Change this:
Code:
if (($coupons->fields['category_id'] !=0) && (zen_product_in_category($product_id, $coupons->fields['category_id'])) && ($coupons->fields['coupon_restrict']=='Y')) return false;
// if category is not restricted(allow) and product not in category deny
if (($coupons->fields['category_id'] !=0) && (!zen_product_in_category($product_id, $coupons->fields['category_id'])) && ($coupons->fields['coupon_restrict']=='N')) return false;
return true;
To this:
Code:
if (($coupons->fields['category_id'] !=0) && (validate_for_category($product_id, $coupons->fields['category_id'])) && ($coupons->fields['coupon_restrict']=='Y')) return false;
// if category is not restricted(allow) and product not in category deny
if (($coupons->fields['category_id'] !=0) && (!validate_for_category($product_id, $coupons->fields['category_id'])) && ($coupons->fields['coupon_restrict']=='N')) return false;
return true;
Bookmarks