News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Solution to remove the decimal number in the price of the product

Started by JoomTut, April 01, 2012, 11:27:20 AM

Previous topic - Next topic

JoomTut

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
http://www.joomtut.com - How to Joomla!
Joomla! & VirtueMart Pro Support.
http://www.joomtut.com/joomla-clip.html - 14 steps to creating a Joomla! website with video clip tutorials

polosat

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

JoomTut

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

:)
http://www.joomtut.com - How to Joomla!
Joomla! & VirtueMart Pro Support.
http://www.joomtut.com/joomla-clip.html - 14 steps to creating a Joomla! website with video clip tutorials

JoomTut

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
http://www.joomtut.com - How to Joomla!
Joomla! & VirtueMart Pro Support.
http://www.joomtut.com/joomla-clip.html - 14 steps to creating a Joomla! website with video clip tutorials

antodones

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

rzrz

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

veeco

As per Virtuemart 2.0.14, now you can change #4 by

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

change to:

private $_nbDecimal       = 0;
Work On Doxa Web Developer Indonesia - http://doxadigital.com |