Author Topic: Multivariant prices  (Read 2422 times)

stawebnice

  • Jr. Member
  • **
  • Posts: 260
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Multivariant prices
« on: May 31, 2015, 00:16:22 am »
Hi,

I have Virtuemart 3.0.9 on Joomla 3.4.1, and I cannot understand how the prices are calculated for children in multivariant:
1. I have this example:
http://www.nova.pippy.cz/pece-o-chodidlo/allpresan-kr%C3%A9mov%C3%A1-p%C4%9Bna-na-nohy-10-urey-2-detail


version with 125 ml should cost 238, but when I enter price without VAT - 196,6942 here in the variant setting on parent:
http://imtp.me/9lnl02lj3.p
, the price  on web is higher than just plus 21% VAT, in fact it  is plus 36% - 268

and the product price settings is without any price modification: http://imtp.me/9lnm02lj3.p

2. also, there is no discount, but there is original price that is the same as current price. Is there a way to disable it for products that have no  discount,please?


Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3844
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Multivariant prices
« Reply #1 on: June 01, 2015, 08:52:17 am »
Hello

Have You found a solution for part of the problem ? Looks ok to me, 238 Kc for the 125 ml bottle.

But I see the crossed out price for the 35 ml bottle.

This is probably the result from a rounding error in VM 3. If You change the cost price to 90,08 Kc it will work.
I have not the time to look for this right now, but Max could probably easily find it. I think that there is
a comparison between a rounded price and a non rounded price. This is just a guess and someone
should look into this and find the cause for the discount showing up.

You could use only 2 decimals as a work around for now.


Jörgen @ Kreativ Fotografi

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

stawebnice

  • Jr. Member
  • **
  • Posts: 260
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Re: Multivariant prices
« Reply #2 on: June 01, 2015, 12:03:14 pm »
Hi Jörgen,
I am not sure that I understand what exactly needs to be done.
when I set the decimals in CZK in currencies to 2, it get prices like  12,00 and it does not remove the crossed price
is there another way to set the rounding?

when I change the base price to e.g. 12,02 instead of 12,0222121 which is something Virtuemart makes up itself   when I check calculate the costs price, it does help either

the price that you see correctly is only because I entered a price/1,36 into the custom field to get the price on site right for this moment,but it still does not work...


Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3844
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Multivariant prices
« Reply #3 on: June 01, 2015, 12:57:29 pm »
Hello

Sorry if I was a bit unclear. If I enter 90.08 instead of 90.08264 I don´t get any crossed out prices. Readjust the cost price to two valid decimals and save. This works for me. If You would enter 90.081 it does not work indicating that VM compares rounded figures with unrounded ones somewhere in the code. I would consider this as a bug, but it is not up to me to make that judgement. In the mean time, truncate all Your troubling cost prices to two decimals. This should be a work around for now.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

stawebnice

  • Jr. Member
  • **
  • Posts: 260
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Re: Multivariant prices
« Reply #4 on: June 01, 2015, 13:25:22 pm »
hi,

I updated  the rounding of  prices in database to2 decimals, but it did not help at all:

http://imtp.me/9lru02lj3.p

http://imtp.me/9lrw02lj3.p

http://www.nova.pippy.cz/damske-puncochy/calze-20-den-annes-detail the prices are still crossed...

any other idea,please?

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3844
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Multivariant prices
« Reply #5 on: June 01, 2015, 14:09:18 pm »
Hello again

Sorry that it does not work as I said. I have 25 % tax in my shop and with 25 % tax and 2 decimals it works. Tested with 21 % and it does not work, exactly as You said. Rounding to 91 which gives 110.11 works. Only truncating in the database will probably not work. It seems that the result from the tax caculation must give a result with not more than 2 decimals.

I don´t have any easy solution right now, but I think that the calculated result (final prize) must be generated to max 2 decimals to work, for right now anyway.

In order to get this working right now you could play with cost prices that together with 21 % tax only gives a maximum of two decimals. Sorry that I can´t offer any better ideas right now. I have not seen this in my shop. But this is because i use 25 % tax and have used prices that don´t get me any unwanted decimals. The problem is easy to replicate, so ther should not be any problem for the VM developers to solve this. But If my final price price calculation gives more than 2 decimals I get the same problem. But as I told You before I have other prices and taxes so this is not a problem for my shop.

I think this should be considered a bug.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10213
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multivariant prices
« Reply #6 on: June 08, 2015, 12:57:27 pm »
You are on a wood path.

Vm calculates from the net price. VM has two different modes "round any step in between" and "round only display".

So if your tax is 25% and your product price is 1.5 € your vat tax is

1.5 euro + (1 + 0.25) * 1.5 = 1.875

The amount for the calcuation is for "round only display" => 1.875,

If you set for your currency a rounding of 3 you will see 1.875, if you set a rounding of 2 you see 1.88 and if you set it to 1 you see 1.9 and if you set it to 0 you get 2€.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3844
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Multivariant prices
« Reply #7 on: June 08, 2015, 13:18:10 pm »
Sorry Milbo I don´t understand the part of the Wood path.

It works very well for me with 25% discount. i don´t think I have seen this on my own website. But using stawebnices figures VAT 21 % and some of her prices in my website I get a discounted price displayed.

I will check tonight to see if I have something in the rounding settings that could cause this. But as I already said with my VAT 25 % it works very good.

regards

Jörgen @ Kreativ Fotografi


Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3844
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Multivariant prices
« Reply #8 on: June 08, 2015, 17:18:09 pm »
Hello again Milbo

I have tried some settings and have found that as soon as the final price has more than 2 decimals, You get a discounted price :(
You can see the images illustrate the following.

Round-display-only-error-discount-01.jpg       (settings for file 01 - 05)
Round-display-only-error-no-discount-02.jpg  (no discounted price)
Round-display-only-error-no-discount-03.jpg  (product price)
Round-display-only-error-discount-04.jpg       (discounted price)
Round-display-only-error-discount-05.jpg       (product price)

If I check the option Round only display, I get:
Round-all-no-error_no-discount-11.jpg  (settings for file 11-15)
Round-all-no-error_no-discount-12.jpg  (no discounted price)
Round-all-no-error_no-discount-13.jpg  (product price)
Round-all-no-error_no-discount-14.jpg  (no discounted price)
Round-all-no-error_no-discount-15.jpg  (product price)

It looks as far as I can see right now, that I don´t get any unwanted discounts when I turn off Round only display.

If this is the solution to the problem, then it would be great :)

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3844
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Multivariant prices
« Reply #9 on: June 08, 2015, 17:19:41 pm »
More images
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3844
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Multivariant prices
« Reply #10 on: June 08, 2015, 17:21:40 pm »
Last images
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.