limit the display of number digits in the price

  • Posts: 37
  • Thank you received: 3
7 years 11 months ago #239451

-- HikaShop version -- : 2.6.3
-- HikaMarket version -- : 1.7.0

Hello,
how can I limit the display of number digits in the price in the front vendor panel?

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 11 months ago #239454

Hi,

HikaShop have a limitation of 5 digits for the prices.
In HikaMarket you can set limitations for the vendor about the minimum price and the maximum price but you can't influence the number of digits.

If you have some taxes, the price with tax will be generally a rounded one, but the price without tax could have several digits and in that case, having 5 digits is essential.

You can see to customize the product edition view for the price edition part.
In your customization, you can see to remove the extra "0" digits (by converting the string into a float).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 37
  • Thank you received: 3
7 years 11 months ago #239496

Thank you Jerome,
I do not understand how I savsem remove extra display 5 digits

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 11 months ago #239513

Hi,

It's hard to give you a precise answer because depending your ACL configuration ; it could affect different parts in the view "productmarket / form_price".
But the idea is to display a number instead of a string.
Like in the view, you can find the display of the price value

echo @$price->price_value;
And you can convert it into a float number before the display
echo (float)hikamarket::toFloat(@$price->price_value);
And the extra digits won't be display.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Ilya.bps

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

  • Posts: 37
  • Thank you received: 3
7 years 11 months ago #239680

Thanks Jerome.

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

Moderators: Obsidev
Time to create page: 0.074 seconds
Powered by Kunena Forum