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

Round to nearest 5 / 10

Started by Za42, November 23, 2015, 14:37:53 PM

Previous topic - Next topic

Za42

Hello there,

I was wondering if there is a way to round the discounted final sales price to the nearest 5 THB or nearest 10 THB.

Using the discount calculation is great, but I would prefer the final sales price to be in multiples of 5 THB.

Site is www.divegearthailand.com

Using Joomla 3.4.3, VM 3.0.9.4

All help much appreciated!

GJC Web Design

never tried but heard a rumour that the VM config setting -> Use the Rappenrundung for Swiss CHF  -- rounds to 5/10..
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

GJC Web Design

Did a bit of work on this...   Use the Rappenrundung for Swiss CHF  only affects the display

to get it to work on the actual amounts being used in calc (tax, the stored amounts etc) it needed a hack to the the administrator\components\com_virtuemart\helpers\calculationh.php

only use if $this->vendorCurrency_numeric==756 if Swiss francs

function roundInternal($value,$name = 0) {
if(!$this->_roundindig and $name!==0){
if($this->vendorCurrency_numeric==756 and VmConfig::get('rappenrundung',FALSE)=="1"){
//vmdebug('roundInternal rounding using rappenrundung');
return round((float)$value * 2,1) * 0.5;
}elseif(isset($this->_currencyDisplay->_priceConfig[$name][1])){
vmdebug('roundInternal rounding use '.$this->_currencyDisplay->_priceConfig[$name][1].' digits');
return round($value,$this->_currencyDisplay->_priceConfig[$name][1]);
} else {
vmdebug('roundInternal rounding not found for '.$name,$this->_currencyDisplay->_priceConfig[$name]);
return round($value, $this->_internalDigits);
}
} else {
return round($value, $this->_internalDigits);
}
}
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation