Jump to content

Create hook from my custom module for to intercept discounts (cart rule) by order's line


Recommended Posts

Hello!

I've a problem, I've to get the discount percentage applied to the line of each order placed.

Through query it is not viable, since the coupons are saved at the order level, not the applied line.

 

So, I had thought about capturing the moment when PS does it, while the order is being placed, and saving it in a custom table:

ID | order_id | percent_applied 

 

But I am not sure exactly where it performs that calculation, I have checked the core, I have seen several sites where it takes discounts into account but it calls hooks and classes and I lose track of it.

 

Could someone give me a hint where I can intercept this information, so that I can save it?

 

Thanks in advance, greetings.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...