First of all thank you for sharing this, its indeed very usefull to get starter with a store implementation.
I appreciate the flexible add-on function which can be added per each product-type.
However I came across this scenario;
Product A - price $100
-> add-on: deposit $20
-> add-on: upgrade-option-X $10
My question is how to implement calculation of tax only on certain items, in the above example the deposit should not be taxable, but the base price and upgrade-option would be.
What would be your suggestion in the current code base to show tax calculation before the total (not in the basket) and calculate it only on base price + 'applicable' add-ons?
Sorry for the late reply and thanks for using the package. As for you Scenario , had the same kind of situation on a site i implemented this on with the only different that in my case it was a discount codeon the main product but not the optional extras so here is how i tweaked the logic.
1) added a few extra settings to help with the logic, first in site settings on the global settings page added the tax percentage (in my case discount percantage) then on the main product doc type and optiona extra doc type added a checkbox (bool) to set if this is a taxable (discounted) item. So in your case product a and the upgrade-option-x would have this set and deposit wont.
2)In the basket class get the global set tax (discount) percantage and in the logic to add the extra or main product extend this to check for the taxable (discounted) bool if set then adjust the price of that item with that and add a message to the item class if need be to say it has been taxed (discounted).
3) with tax now being globallly set, remove it as an extra and if you need add some extra details on your product to explain what gets taxed and what doesnt
The rest of the basket logic can stay the same with the only thing to note being if for instance you change the quantity of an item them recalculate the item total and tax (discount).
I hope this help, i was thinking of updating package to have both tax and discount working this was and then just use the extras for things like shipping, upgrades etc but to be honest wasnt sure how people were using it and since no one as yet had requested this thought it probably is fine as it is. Would be keep to know how much this would be required by other people that have used this as i want to try and keep it a simple and flebible as posible BUT with all the basics in place as well, let me know how you get on and what site you got this on to have a peak lol.
Thank you for the detailed reply. Almost couldnt find this page pack since the recent changes.. : )
Do you have any sample code with the tax logic added as per the points you have noted 2 and 3?
I have tried to implement some logic but didnt progress as expected.
If you have a sample code that you can share, for reference/example purposes, that would be greatly apprecited.
only just realised from your comment that the site has changed too lol, will put something to gether for you and post it here tempted to actual update the package will see which is quicker lol
@kello uploaded v2 of the package with the added functionality to enable you to add price adjustments directly to products and or extras. On the system added a new picker for the price adjustments which like the extras are set in site setting. So with that you can now add/subtract an amount based on a momentary value or percentage which you can use for things like tax, discount , upgrades etc.
See http://rdmonlinesimplestore.uk/ for the updates test site and you know where to get the package ;) let me know what you think of the updates.
Many thanks for following up and sharing the update!
I have added it on a clean/plain U7 install, now the "Store Extras Container" doctype have the new "Price Extras" selector.
But it seems either a doctype is missing or Im missing something (not enough coffee yet ..) I cant make any selection with it. When i check the developer->data-type the selector indicates there might be an another doctype - but cant find it in the package install.
Under Settings, there is only "Store Extras Container", which then it only have "Store Extra Item" doctype under it
Sorry mate my bad and you are right it needs an extra doc type which is basically a multi npde tree picker but specifically set to the shop extras and new price doc types.
If you send me your email address direct to [email protected] will create you a full admin account on the live test site so you can see how its all set up.
Tax next to Total
First of all thank you for sharing this, its indeed very usefull to get starter with a store implementation.
I appreciate the flexible add-on function which can be added per each product-type.
However I came across this scenario;
Product A - price $100
-> add-on: deposit $20
-> add-on: upgrade-option-X $10
My question is how to implement calculation of tax only on certain items, in the above example the deposit should not be taxable, but the base price and upgrade-option would be.
What would be your suggestion in the current code base to show tax calculation before the total (not in the basket) and calculate it only on base price + 'applicable' add-ons?
Would appreciate your input.
cheers
Hi @kielo
Sorry for the late reply and thanks for using the package. As for you Scenario , had the same kind of situation on a site i implemented this on with the only different that in my case it was a discount codeon the main product but not the optional extras so here is how i tweaked the logic.
1) added a few extra settings to help with the logic, first in site settings on the global settings page added the tax percentage (in my case discount percantage) then on the main product doc type and optiona extra doc type added a checkbox (bool) to set if this is a taxable (discounted) item. So in your case product a and the upgrade-option-x would have this set and deposit wont.
2)In the basket class get the global set tax (discount) percantage and in the logic to add the extra or main product extend this to check for the taxable (discounted) bool if set then adjust the price of that item with that and add a message to the item class if need be to say it has been taxed (discounted).
3) with tax now being globallly set, remove it as an extra and if you need add some extra details on your product to explain what gets taxed and what doesnt
The rest of the basket logic can stay the same with the only thing to note being if for instance you change the quantity of an item them recalculate the item total and tax (discount).
I hope this help, i was thinking of updating package to have both tax and discount working this was and then just use the extras for things like shipping, upgrades etc but to be honest wasnt sure how people were using it and since no one as yet had requested this thought it probably is fine as it is. Would be keep to know how much this would be required by other people that have used this as i want to try and keep it a simple and flebible as posible BUT with all the basics in place as well, let me know how you get on and what site you got this on to have a peak lol.
Denford
Hey Denford!
Thank you for the detailed reply. Almost couldnt find this page pack since the recent changes.. : )
Do you have any sample code with the tax logic added as per the points you have noted 2 and 3? I have tried to implement some logic but didnt progress as expected.
If you have a sample code that you can share, for reference/example purposes, that would be greatly apprecited.
cheers!
Hi Kielo,
only just realised from your comment that the site has changed too lol, will put something to gether for you and post it here tempted to actual update the package will see which is quicker lol
That sounds great! Looking forward.
@kello uploaded v2 of the package with the added functionality to enable you to add price adjustments directly to products and or extras. On the system added a new picker for the price adjustments which like the extras are set in site setting. So with that you can now add/subtract an amount based on a momentary value or percentage which you can use for things like tax, discount , upgrades etc.
See http://rdmonlinesimplestore.uk/ for the updates test site and you know where to get the package ;) let me know what you think of the updates.
Hi Denford!
Many thanks for following up and sharing the update!
I have added it on a clean/plain U7 install, now the "Store Extras Container" doctype have the new "Price Extras" selector. But it seems either a doctype is missing or Im missing something (not enough coffee yet ..) I cant make any selection with it. When i check the developer->data-type the selector indicates there might be an another doctype - but cant find it in the package install.
Under Settings, there is only "Store Extras Container", which then it only have "Store Extra Item" doctype under it
Do you think its the doctype?
cheers!
Sorry mate my bad and you are right it needs an extra doc type which is basically a multi npde tree picker but specifically set to the shop extras and new price doc types.
If you send me your email address direct to [email protected] will create you a full admin account on the live test site so you can see how its all set up.
Source code now available on git hub here https://github.com/Dennydante/SimplestStore
is working on a reply...