How to Hide Decimals in Product and Listing Views
1 year 4 months ago #367552
by Jabatec
Javier Ballester
How to Hide Decimals in Product and Listing Views was created by Jabatec
Hi,
We need to edit the price display (views) to hide the decimals of the price (tax included) in both the product view and the product listing view.
This change should not affect the cart view, where the decimals should still be displayed as shown in the attached image.
Below, we've attached to illustrate the key points:
Product Listing: Shows how we want the price to appear without decimals.
Shopping Cart: Shows how the price with decimals should remain visible.
Thank you
Javier
We need to edit the price display (views) to hide the decimals of the price (tax included) in both the product view and the product listing view.
This change should not affect the cart view, where the decimals should still be displayed as shown in the attached image.
Below, we've attached to illustrate the key points:
Product Listing: Shows how we want the price to appear without decimals.
Shopping Cart: Shows how the price with decimals should remain visible.
Thank you
Javier
Javier Ballester
Please Log in or Create an account to join the conversation.
1 year 4 months ago #367553
by nicolas
Replied by nicolas on topic How to Hide Decimals in Product and Listing Views
Hi,
Edit the view file product / listing_price via the menu Display>Views.
There, change the line:
to:
Note that this assumes that you're only display the prices with the euro currency. If you need to handle several currencies, then, you have to load the currency data from the database based on $price->price_currency_id so that you can display the currency symbol dynamically.
Edit the view file product / listing_price via the menu Display>Views.
There, change the line:
Code:
echo $this->currencyHelper->format(@$price->price_value_with_tax, $price->price_currency_id);
Code:
echo round(@$price->price_value_with_tax) . ' €';
The following user(s) said Thank You: Jabatec
Please Log in or Create an account to join the conversation.
Time to create page: 0.066 seconds