I have 2 shopper groups :
One with VAT 24% and one without VAT.
My custom field calculates the VAT automatically.
Let me help you:
Example
TV 32 inches
Price: 300€
Warranty 2 years from manufacturer
Do you want 1 year extra warranty?
✓ Yes (+40,00€) ☐ Νο
My shop is configured now like this:
If a company (without VAT) buy the TV and the extra warranty, they will pay:
241,94€ for the TV (the same price without VAT) and 40.00€ for the extra warranty.
On the other hand if a regular shopper (he is in 24% VAT shopper group) buy the TV and the extra warranty he will pay:
300€ for the TV and 49.60€ for the extra warranty
But I don't want the regular shopper to pay 49.60€, I want him to pay 40€ like the company because the extra warranty is tax free.
How can I configure it to be the same price for both of the shopper groups?
A mod moved this post and turned it into thread.
I edited my first post for better explanation of what I need.
I thought something like this:
at calculationh.php
line 369
$basePriceShopCurrency = $basePriceShopCurrency + $variant;
First create a table in DB
let's name it CustomVAT
Here we will add a field "VAT24" with value 1.24.
After this:
If shoppergroup with 24% VAT (ID=2)
then
$basePriceShopCurrency = $basePriceShopCurrency + $variant / *CustomVAT Table & VAT24 Field*;
(Asterisks is the code will fetch the 1.24 value from database - I don't know how to write it though, I am not a programmer)
Then the same
If shoppergroup with 0% VAT (ID=13)
We will add a field "VAT0" with value 1.
Then again
$basePriceShopCurrency = $basePriceShopCurrency + $variant / *CustomVAT Table & VAT0 Field*;
This will give us the desired result. Can anyone help me achieve this?
Hope I helped here.
You can achieve this on doing a custom field plugin and recalculate the warranty dynamically (and remove tax if this is set in custom field warranty).
Eg. something simillar to http://pro.st42.fr/en/shortcodes/checkboxes-insurances.html(i don't modifed it for your case)
Quote from: Studio 42 on January 29, 2018, 16:16:02 PM
You can achieve this on doing a custom field plugin and recalculate the warranty dynamically (and remove tax if this is set in custom field warranty).
Eg. something simillar to http://pro.st42.fr/en/shortcodes/checkboxes-insurances.html(i don't modifed it for your case)
I'm sorry but I didn't understand your example
----
I thought another solution:
Via shoppergroup description
At line 369:
Default: $basePriceShopCurrency = $basePriceShopCurrency + $variant;
Desired fix: $basePriceShopCurrency = $basePriceShopCurrency + $variant / *shopper group description*;
I don't know how to call my shopper's shopper group description though..
Your solution is to hack core.
My solution is to use a customfield plugin, so you can customize the render to display :
Do you want 1 year extra warranty?
✓ Yes (+40,00€) ☐ Νο
If you prefer hack the code, i don't agree and this is not safe and your changes get removed on update Vm.
My plugin have not the changes you want, it was only a similar example for the render, not changes for shopper groups, this is specific and code do not exist but i know i can do it.