Let me go directly with an existing sample. I have a product with entity_id=319 that as I'm seeing in sales_flat_invoice table has a discount_amount equal to -100000.

I want to know from where this discount has been input but I have no idea. I know it may come from a promotion rule or a coupon code but couldn't make a relation between these three.

It would be helpful if a relationship between db tables could be pointed out.

1 Answer 1


During the checkout , Magento checks if there is any sales rules (has been set in the backend) applies to one or more of the checkout items (Quote items) and then add these rules (discount , free shipping, etc..) to the total object , so once the order is placed , the quote object will be converted to an order object and they both has the same totals (including the sales rules) .

So in the backend , upon creating an invoice , Magento will create the invoice based on the totals and sales rules from the order object items .

Check this link for more info : https://www.netmatter.co.uk/blog/tutorial-magento-catalog-price-rules-promotions-4796/

Hope this help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.