News:

Looking for documentation? Take a look on our wiki

Main Menu

Product Height, Width and Weight Decimal Points

Started by atiart, January 27, 2017, 13:54:18 PM

Previous topic - Next topic

atiart

Hi,

How can I remove the Decimal Points from Product Detail Display.

Actually shows the decimal point like this 5.000 ( i want it only 5)
Which File must i change for this?

I use the latest Joomla 3.6.5 with VM 3.0.18

Thanks for Help

Best Regards

Atilla

Milbo

You should not change any file. The customfield Property has the feature "rounding" inside, just set a 0 in the value field.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

atiart

Hi Milbo,

Thanks but this is not what i need. I want it changed by Variants.
Here is the link from the site for check. http://unitedsevens.de/index.php/zeo-soft

Grüss dich Milbo,

Ich habe gesehen das Du auch Deutsch schreibst.

Also ich habe nur Produktgewicht angelegt und das bei Allgemeinen Varianten zur Auswahl gestellt, aber die Rundung stört.

Danke dir im Voraus.

Gruss
Best Regards Atilla

Milbo

The variants with the text customfield are not suiteable for that, because they do not change any attribute of your product.

So you need the Generic child variant or the multivariant, which uses child products. and then counts, what I already said.

Either you use the layout to display the product weight, then you must add the rounding yourself, or you use the customfield "property".
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

It makes not a lot sense to use the english forum with german language, for that we have a german forum http://forum.virtuemart.de/ greets :-)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

atiart

Hi,

You writed:
"Either you use the layout to display the product weight, then you must add the rounding yourself, or you use the customfield "property".

How can i rounding at my self?
Is there other solution to change a File with overwritten? And which File?  :'(

Thanks

Best Regards

Atilla

Milbo

I meant layout overrides. Then you can just add the rounding to the code, or you use the customfield property, which is exactly written for this case
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

geertplovie

Hi,

I'm having a small issue with the rounding of the product sizes.

I have a product wich is 300m long and has a width of 0.5m (it's a foil)
I use the Product Dimensions and weight to show this product data.
I've read that these are made for the calculation of the shipping cost but when the fields already exists, why should I create custom fields...? (My opinion)

The problem is that it shows like:
Lenght: 300M (-> this is OK)
Width: 0M  (this should be 0.5M)

Virtuemart is rounding the number 0.5 -> 0

I've replaced <?php echo floor($this->product->product_width) ?> to <?php echo $this->product->product_width ?> but that didn't solved it.

All help is welcome

thanks!



Milbo

You use already an override then. Becaus the length, weight is not displayed in the default layout. If you want to show these values, we have the customfield property. So you can add the customfield and say which dimension of the product should be displayed and you can set the rounding there. So you would add 2 customfields, one with rounding 0 and one with rounding 1.
and I would use a product pattern for that.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/