Closed daphilli224 closed 3 months ago
Oy! I'd forgotten how much I'd changed that file. calculate_deductions
's returned-array's "signature" contains additional elements, too. Let me give that a closer look, as zc200 is nearing release to see if I can wangle some form of notifier that will serve your request.
While that notification isn't exactly what you requested, I've provided all the elements used to perform the in-module deduction calculation, with the opportunity to override the array of deduction-related information returned for display.
Let me know if that serves your needs.
@daphilli224, please let me know if that notification works for you. I'd like to get this release of EO "out" this week.
Sorry, 157c problems have delayed my testing. I'll get it done today. Thanks for the update!
I need $order->products rather than $order->info since I need to go through each product in the order to see if it's discountable or not. If a product in the order is non-discountable, I need to adjust $discount. Dave
I need $order->products rather than $order->info since I need to go through each product in the order to see if it's discountable or not. If a product in the order is non-discountable, I need to adjust $discount. Dave
Would it suffice to pass the full $order
in the notification's first parameter instead of just $order->info
?
could one just add global $order
to their observer? or is that so cliche now?
could one just add
global $order
to their observer? or is that so cliche now?
True, that.
Passing $order would work fine.
If the ot_group_pricing.php optional override file in edit_orders 4.7.0 gets incorporated in core eventually, could you please include a notifier in function calculate_deduction() just before:
foreach ($discount_tax_groups as $key => $value) { $discount_tax_groups[$key] *= $discount_percentage; }
which is located just before return from the function.The use case is that some products (only a few), both taxable and non-taxable, are not discountable for members of the discount group. The associated observer would adjust $discount_total, $discount_tax, and discount_tax_groups[$key]. This assumes that order_total files remain non-overridable in future versions of zen-cart.