VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: JoomTut on April 01, 2012, 11:27:20 AM

Title: Solution to remove the decimal number in the price of the product
Post by: JoomTut on April 01, 2012, 11:27:20 AM
Solution to remove the decimal number in the price of the product:

In Joomla! Administrator -> Conponents -> VirtueMart:

1/ Go to Configuaration -> Select Pricing tab -> Show Following Prices
- Select Enable shoppergroup specific price display
- Select Show Prices
- Select any price display as you want in Show Price
- Rounding Digits: 0 (zero)

* Apply to all


2/ Go to Configuaration -> Currencies -> Select your Currency -> Decimals: 0 (zero)

* Apply to the specified currency


3/ Go to Orders & Shoppers -> Shopper Groups -> select -anonymous-:
- Select Enable shoppergroup specific price display
- Select Show Prices
- Select any price display as you want in Show Price
- Rounding Digits: 0 (zero)

* Apply to the specified shoppergroup


4/ Do some hack in VM core => Fixed in version 2.04
- Open file administrator/components/com_virtuemart/helpers/currencydisplay.php
- Find:
public function priceDisplay($price=0, $currencyId=0,$inToShopCurrency = false,$nb = 2){
- Repace with:
public function priceDisplay($price=0, $currencyId=0,$inToShopCurrency = false,$nb = 0){

* Apply to Cart

;D
Title: Re: Solution to remove the decimal number in the price of the product
Post by: polosat on April 02, 2012, 21:46:58 PM
good decision, now the price in the category 612, but in a basket of goods We can see the same result - the price is 612.25
Title: Re: Solution to remove the decimal number in the price of the product
Post by: JoomTut on April 03, 2012, 02:56:00 AM
Quote from: polosat on April 02, 2012, 21:46:58 PM
good decision, now the price in the category 612, but in a basket of goods We can see the same result - the price is 612.25
There are some changes, please see additional #4 in the first post

:)
Title: Re: Solution to remove the decimal number in the price of the product
Post by: JoomTut on April 11, 2012, 08:52:19 AM
Quote from: jtut on April 01, 2012, 11:27:20 AM
4/ Do some hack in VM core
- Open file administrator/components/com_virtuemart/helpers/currencydisplay.php
- Find:
public function priceDisplay($price=0, $currencyId=0,$inToShopCurrency = false,$nb = 2){
- Repace with:
public function priceDisplay($price=0, $currencyId=0,$inToShopCurrency = false,$nb = 0){

* Apply to Cart

=> Fixed in version 2.04
Title: Re: Solution to remove the decimal number in the price of the product
Post by: antodones on April 19, 2012, 16:17:09 PM
How I can do this in product weight?
In the product details I managed to show the weight of the product, but is shown with decimals example: 3.50000 kg, I would like to shew 3.5 kg.
thanks
Title: Re: Solution to remove the decimal number in the price of the product
Post by: rzrz on April 28, 2012, 16:45:48 PM
thanks this is very useful!

But do you know how to shift the 0$ infront $0 ?


update: found it.

Configuration > Currencies > Choose your currency > Positive Format
Title: Re: Solution to remove the decimal number in the price of the product
Post by: veeco on December 20, 2012, 19:55:43 PM
As per Virtuemart 2.0.14, now you can change #4 by

find (line 31):
private $_nbDecimal       = 2;

change to:

private $_nbDecimal       = 0;