prestashop-specs icon indicating copy to clipboard operation
prestashop-specs copied to clipboard

Calculation of shipping discount

Open arouiadib opened this issue 4 years ago • 1 comments

Hello, After some thinking about the calculation of the shipping discount, I came up with the following draft . I hope I it is a good starting point for discussion about this important matter.

image

Some examples:

situation: shop with:

  • 3 products in catalog: product1, product2 and product3.
  • 2 enabled non-free carriers: carrier1 with price1 and carrier2 with price2
  • product1 has carrier1 as specific carrier.
  • product2 has carrier2 as specific carrier.

1 . Case n>0

  • 1or many cart rules with free shipping action, all without any restrictions.
  • 1 or many cart rules with free shipping action, all with restrictions.

Examples:

  • cart 1: product1 and product2 and product3. shipping discount = price1 + price2

  • cart 2: product1 and product3 shipping discount = price1 if product3 is carried by carrier1 shipping discount = (price1+ price2) if product3 is carried by carrier2

  • cart 3 : product2 and product3 shipping discount = price2 if product3 is carried by carrier2 shipping discount = (price1+ price2) if product3 is carried by carrier1

2. Case of n=0

  • 0 cart rules with free shipping action without any restrictions (n=0).
  • 2 cart rules with free shipping action with restrictions.
    • cartRule1 is restricted to carrier1
    • cartRule2 is restricted to product2

Examples:

  • cart 1: product1 shipping discount = price1

  • cart 2: product2 shipping discount = price2

  • cart 3: product3 shipping discount = 0

  • cart 4: product1 and product2 shipping discount = price1+price2

  • cart 5: product2 and product3 shipping discount = price2 if product3 shipped by carrier2 shipping discount = (price1+ price2) if product3 shipped by carrier1

  • cart 6: product1 and product3 shipping discount = price1 if product3 shipped by carrier1 shipping discount = 0 elsewhere

  • cart 7: product1and product2 and product3 shipping discount = (price2 + price1) if product3 shipped by carrier1 shipping discount = price2 if product3 is shipped by carrier2

arouiadib avatar Apr 03 '20 21:04 arouiadib