Skip to main content

Round Price in Mass Action Operation

More
1 year 5 months ago #367029 by NTV
-- HikaShop version -- : 5.1.6
-- Joomla version -- : 5.3.0
-- PHP version -- : 8.1.32
-- Browser(s) name and version -- : Firefox 138.0.1 (64-bit)

Hello,
due to a percentage based increase in our prices, our price fields in the database have a lot of decimal points.

This has not been an issue for now, but now that we want to display the retail price, it is displayed as such:
"Price: 2,65 € (2,65 €)"

When I manually get rid of the excess decimal points we have the behavior we want:
"Price: 2,65 €"

How can I specify in a Mass Action to cut the decimal points off so only the first two remain?

Thanks in advance

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

More
1 year 5 months ago #367030 by nicolas
Hi,

I don't think that the solution is removing excess decimals.
I think that the price display behavior change comes from you manually saving the product in the backend, not changing the price decimals.
Creating a mass action to remove the decimals can be done with an action "update the values" on the "price_value" column, with the "operation" mode and the value: round(price.price_value,2)
But you might still have the problem after running that mass action.
The following user(s) said Thank You: NTV

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

More
1 year 5 months ago #367036 by NTV
Hi nicolas,

the round() function does exactly what I need and the display changed as expected - thank you!

Out of curiosity: How can I see which other functions are available? Do mass actions just use the mysql database functions or do they have their own code?

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

More
1 year 5 months ago #367039 by nicolas
Hi,

It indeed just use the MySQL functions.
The following user(s) said Thank You: NTV

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

More
1 year 5 months ago - 1 year 5 months ago #367044 by NTV
So I guess we're getting AI spam then? :unsure:

EDIT: Thanks for deleting.
Last edit: 1 year 5 months ago by NTV.
The following user(s) said Thank You: nicolas

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

Time to create page: 0.096 seconds
Powered by Kunena Forum