VirtueMart Forum

VirtueMart 2 + 3 => Product creation => Topic started by: webberry on February 16, 2012, 11:10:30 am

Title: Wrong price: custom fields, two taxes
Post by: webberry on February 16, 2012, 11:10:30 am
We have products with different sizes. For this we use custom fields.
We also have two different taxes for the products (Tax 8% and tax 2.5%).

Now the product price in the product detail is wrong, both taxes are counted together, although I only chose one tax for the product. The price in the shopping cart is correct.

Please take a loot at the print screens.

Can somebody help us? Is this a bug?

Thanks, Webberry



[attachment cleanup by admin]
Title: Re: Wrong price: custom fields, two taxes
Post by: rustle on February 25, 2012, 05:01:52 am
I was encountering this issue
I solved it by making sure that the tax rules are identified in both a country and subsequent state.
Also in the billing info for the customer they must also select and a country and a state

If you do not do this VM has a tendency to apply multiple taxes when it should not

I hope this helps
Title: Re: Wrong price: custom fields, two taxes
Post by: webberry on February 27, 2012, 15:50:09 pm
Hi
Thanks for your reply.
Unfortunately it's still not working. I identified both with a country and state.
We've tried all the settings, with categories, without etc.
The problem exists only at the options.
Have you got an other idea?
Thanks
Title: Re: Wrong price: custom fields, two taxes
Post by: webberry on March 12, 2012, 09:52:13 am
Is there anybody who can help us?
Title: Re: Wrong price: custom fields, two taxes
Post by: rustle on March 12, 2012, 15:08:47 pm
Hi Webberry
please read this post in full
http://forum.virtuemart.net/index.php?topic=98912.0

what you have to do is a template override to hide the multiple taxes in the cart until the  checkout process has been completed
then the correct tax will appear based upon the criteria you wold like

it took me awhile to get my head wrapped around it - but it works
Title: Re: Wrong price: custom fields, two taxes
Post by: Spyros Petrakis on April 08, 2012, 21:36:47 pm
I think this is a bug , it makes no sense to calculate custom fields by adding every tax that you create in your shop, when you have set a specific tax for the product.
Title: Re: Wrong price: custom fields, two taxes
Post by: sebix on April 28, 2012, 09:48:19 am
Is there a solution about this bug ? I spent a lot of time to try to fix this but i still have two additional taxes.
Title: Re: Wrong price: custom fields, two taxes
Post by: Milbo on May 30, 2012, 19:05:13 pm
I think also this is a bug, shouldnt be that way. Seems that the override for a product is not taken for calculation of the variant. Please tell me which custom you are using.
Title: Re: Wrong price: custom fields, two taxes
Post by: sven.w on June 12, 2012, 16:06:11 pm
I think also this is a bug, shouldnt be that way. Seems that the override for a product is not taken for calculation of the variant. Please tell me which custom you are using.

Hello, we're having the same issue here (using the custom field type "cart variant").
Any idea if this issue has been adressed yet? (I'm just wondering as i haven't seen any similar ticket on dev.virtuemart.net)

regards sven
Title: Re: Wrong price: custom fields, two taxes
Post by: escapezone on July 17, 2012, 01:07:30 am
Hello, we're having the same issue here (using the custom field type "cart variant").

Does anyone find a solution for this problem plz?
Title: Re: Wrong price: custom fields, two taxes
Post by: mdelreal on July 24, 2012, 22:46:38 pm
The same problem.

Until this bug is fixed, somebody knows how to hide the prices of custom fields

Thank
Manuel
Title: Re: Wrong price: custom fields, two taxes
Post by: easy on July 28, 2012, 21:48:33 pm
search this forum, it was somewhere here, you have to edit one file only
Title: a solution for "Wrong price: custom fields, two taxes"
Post by: frogybella on January 25, 2013, 18:33:54 pm
VM 2.0.18a
Path : /administrator/components/com_virtuemart/models
File : customfields.php

Hi,

We have hacked this file to correct the problem this way :

Line 870-871 :
Code: [Select]
$price = self::_getCustomPrice($productCustom->custom_price, $currency, $calculator, (int)$product->product_tax_id);
$productCustom->text = JText::_ ($productCustom->custom_value) . ' ' . $price ;

We have added a new parameter to the function _getCustomPrice filled with the product's tax id. On second line, JText function has been added for translation support (nothing to do with the subject but it was nice to have it work too...).

Then on line 964, the beginning of the function become :
Code: [Select]
static function _getCustomPrice($customPrice, $currency, $calculator, $idtax) {
if ((float)$customPrice) {
$price = strip_tags ($currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($customPrice, $idtax)));
We declare the new parameter and use it in the calculateCustomPriceWithTax function call.

It might not correct everything and every cases. For each product using the custom file you have to select the tax rate. A better solution could be found... but it works for us, and we can finish the project!

Hope this help,
Regards,