I am looking to apply product price based on total cart weight. Each product has an additional custom_price field which should be applied if cart weight exceeds 100kgs.
Example:
Product A - Weight 10kg, Regular price 100, Custom price field 80
Product B - Weight 20kg, Regular price 200, Custom price field 180
Scenario 1
Products A and B are added in the cart with certain unit quantity and the total cart weight is less than 100kgs
In this case, regular price should be applied to both products. ie For Product A - 100 and For Product B - 200
Scenario 2
Products A and B are added in the cart with certain unit quantity and the total cart weight exceeds 100kgs
In this case, Custom price field should be applied to both the products ie For Product A - 80 and For Product B - 180.
Further displaying the total difference amount (ie total of both products with regular price - total of both products with custom price) as a discount.
How can I achieve this? I will appreciate any help on this.
I did check a similar question in this link but it is based on the discount percentage and I am looking to call a custom price field.