thirtybees / thirtybees

thirty bees - e-commerce that works for you
https://thirtybees.com/download
739 stars 242 forks source link

Order slip with cart rules is dubious #1857

Open eschiendorfer opened 2 months ago

eschiendorfer commented 2 months ago

Case:

Up to here everything looks clean. But what the system does, is very messy. It saves the total (100$) to order_slip table. There is no column for id_cart_rule or cart_rule_value or so. Instead the only thing it does it saves "order_slip_type" to 1.

This has a lot of drawbacks.

Any proposal what would be the right way?

https://github.com/thirtybees/thirtybees/blob/main/classes/pdf/HTMLTemplateOrderSlip.php#L166-L190

I wonder, if it would work, if we just join ps_orders and use total_discounts_tax_incl / total_disconts_tax_excl? Instead of going for $order->getCartRules()?

eschiendorfer commented 2 months ago

Now thinking about it, there is maybe also a workaround. Should I just substract the 10% directly from each product line!?