Author Topic: Solution to remove the decimal number in the price of the product  (Read 14479 times)

JoomTut

  • Jr. Member
  • **
  • Posts: 64
    • How to Joomla!
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:
Code: [Select]
public function priceDisplay($price=0, $currencyId=0,$inToShopCurrency = false,$nb = 2){- Repace with:
Code: [Select]
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

  • Beginner
  • *
  • Posts: 4
Re: Solution to remove the decimal number in the price of the product
« Reply #1 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

JoomTut

  • Jr. Member
  • **
  • Posts: 64
    • How to Joomla!
Re: Solution to remove the decimal number in the price of the product
« Reply #2 on: April 03, 2012, 02:56:00 am »
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

  • Jr. Member
  • **
  • Posts: 64
    • How to Joomla!
Re: Solution to remove the decimal number in the price of the product
« Reply #3 on: April 11, 2012, 08:52:19 am »
4/ Do some hack in VM core
- Open file administrator/components/com_virtuemart/helpers/currencydisplay.php
- Find:
Code: [Select]
public function priceDisplay($price=0, $currencyId=0,$inToShopCurrency = false,$nb = 2){- Repace with:
Code: [Select]
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

  • Beginner
  • *
  • Posts: 3
Re: Solution to remove the decimal number in the price of the product
« Reply #4 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

rzrz

  • Jr. Member
  • **
  • Posts: 65
Re: Solution to remove the decimal number in the price of the product
« Reply #5 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

veeco

  • Jr. Member
  • **
  • Posts: 98
  • Joomla, Seblod, and Virtuemart is my Arsenal
    • Doxadigital Web Development Indonesia
  • VirtueMart Version: 2.0.20b
Re: Solution to remove the decimal number in the price of the product
« Reply #6 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;
Work On Doxa Web Developer Indonesia - http://doxadigital.com |