Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for notifier in ot_group_pricing.php #237

Closed
daphilli224 opened this issue Mar 13, 2024 · 9 comments
Closed

Request for notifier in ot_group_pricing.php #237

daphilli224 opened this issue Mar 13, 2024 · 9 comments

Comments

@daphilli224
Copy link

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.

@lat9
Copy link
Owner

lat9 commented Mar 13, 2024

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.

@lat9 lat9 added the change label Mar 14, 2024
@lat9 lat9 added this to the v4.7.1 milestone Mar 14, 2024
lat9 added a commit that referenced this issue Mar 14, 2024
@lat9
Copy link
Owner

lat9 commented Mar 14, 2024

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.

@lat9
Copy link
Owner

lat9 commented Mar 18, 2024

@daphilli224, please let me know if that notification works for you. I'd like to get this release of EO "out" this week.

@daphilli224
Copy link
Author

Sorry, 157c problems have delayed my testing. I'll get it done today. Thanks for the update!

@daphilli224
Copy link
Author

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

@lat9
Copy link
Owner

lat9 commented Mar 19, 2024

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?

@proseLA
Copy link
Contributor

proseLA commented Mar 19, 2024

could one just add global $order to their observer? or is that so cliche now?

@lat9
Copy link
Owner

lat9 commented Mar 19, 2024

could one just add global $order to their observer? or is that so cliche now?

True, that.

@daphilli224
Copy link
Author

Passing $order would work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants