how to update price for each product depending on

  • Posts: 138
  • Thank you received: 1
9 years 7 months ago #225547

-- HikaShop version -- : last
-- Joomla version -- : last
-- Error-message(debug-mod must be tuned on) -- : non

Hi we updated the price of all our products by using mass action. we added this code into it:

price.price_value+2

What it did it added 2.42 to each price. The 42 is coming from teh 21% tax we ad on each product. Now did this give very strange prices from 2,95 we now have for exampe prices like: 5,37.

Is there an easy way to make each price that has this 37 cents in its price change into price+ 95 cents? So each price will be ending on 0,95 again?

We want this because 0,37 just looks strange. Or should we lower all prices again with 2.42 and higher them with 3,00? if so what would be the code be? both for lowering it and for highering it with 3?

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13674
  • MODERATOR
9 years 7 months ago #225583

Hi,

price_value is the price without taxes.
So if you want to add 2 to the price with tax and that you have a tax rate of 21%, you actually want to add 1.65289 to the price_value
And if you already added 2 to your prices, then you want to remove 2 - 1.65289 = 0.34711

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 1
9 years 7 months ago #225622

Hi thanks for your answer. First of al you mean that the code we used: price.price_value+2 = price +tax
And that price_value = the price without taxes?

Second we did try to do different values before but everything after a point or a komma doesnt work. We can only enter 1 or 2 or 3 etc.

We did try it now again and when we enter for example:

price_value+0,47933884

(calculation we used: €3,00 - 2,42 = 0,58
0,58 : 121 = ... x 100= 0,47933884

then this happends: tabel price_value, doesnt excist

when we use price.price_value+0,47933884

This happends: kolomn price_value, doesnt excist

When we use price.price_value+2

then this happends: It works and the price gets higher with 2,42

So why doenst it work after a komma for us? Something wrong in the system or are we doing something wrong?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 7 months ago #225635

Hi,

We made fixes about that in our latest version of HikaShop, this version is not yet release but should arrive soon.
But for every version the comma is not working, you have to use a dot instead.

So in your case use: price.price_value+0.47933884

The following user(s) said Thank You: extreme

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 1
9 years 7 months ago #225707

thanks that did the trick

Please Log in or Create an account to join the conversation.

Time to create page: 0.083 seconds
Powered by Kunena Forum