-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discount vs. Shipping costs issue #106
Comments
So, I have investigated this, and I want to discuss my findings. I found out that when you have a discount (korting) it gets added to Subtotal, but why? By adding discount to subtotal you showing what the original price would have been but that is not relevant not only that but by adding the discount to subtotal calculating shipping does not work properly. See example above. If I remove discount from subtotal, I then get 151,38 this means that the client does needs to pay shipping, because free shipping is subtotal >= 250. So, if we want to show original price, we need to use another field and not subtotal. How should we proceed?
Any other suggestions? @leedavi |
I'm not sure... but should that discount be a negative figure? Then it would be correct? Although it is called "discount", the math can dictate it could be a positive or negative amount. And hence displays the sum of the cart, plus discount (negative or positive). |
I'm not following, how can a discount be positive? Discount is always negative. (a deduction from the usual cost of something.) I think that we should use sum of the cart + tax to calculate shipping. This because cart items already includes the discounted price. I made the following changes and it seems to be working fine. |
I went a head and made a few changes. So now you can now choose subtotal or cart sum to calculate shipping. What do you think of this approach? @leedavi |
I have not had a deep look. But I think the trouble here is you change the "CartTotal". I'm unsure of where the CartTotal is used or displayed, but this could cause issues with other areas. You are best to save the value in another xml element, you can create one called anything you wish. And then change the shipping calculation to use the new value if the option "calc of total" is selected. We must not effect any other site with the new option. Everything must stay the same for other shops without the option selected, This sounds obvious and easy, but the key word is "separation", do not use any existing variables, if you need the values, copy them to a new XML element. |
Also, remember that extra plugins and providers work on the data, so although it all looks OK in the core OpenStore code, it may not be OK in a plugin that uses that value. The new option path should be completely separate, even if it looks perfectly OK to change the code in the core. |
This comment has been minimized.
This comment has been minimized.
The CartData class inherits the Purchasedata class, which is PurchaseInfo XML. You can use the nodeXml to add and remove, but it's easier to use a property command, something like this.... PurchaseInfo.SetXmlPropertyDouble("genxml/total2",total) |
We've set free shipping for orders above 200 euro's
However, when someone orders for 220 euro's and get's a discount of 50 euro's the total of the order is 170 euro's.
But the free shipping still applies because it looks at the 220 euro's instead of the 170 euro's.
We think this is wrong.
So at least an option should be built in to apply free shipping on the subtotal or on the total amount.
This way people can choose which way to apply the shipping costs
The text was updated successfully, but these errors were encountered: