VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: atiart on January 27, 2017, 13:54:18 PM

Title: Product Height, Width and Weight Decimal Points
Post by: atiart on January 27, 2017, 13:54:18 PM
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
Title: Re: Product Height, Width and Weight Decimal Points
Post by: Milbo on January 27, 2017, 22:22:58 PM
You should not change any file. The customfield Property has the feature "rounding" inside, just set a 0 in the value field.
Title: Re: Product Height, Width and Weight Decimal Points
Post by: atiart on January 28, 2017, 22:22:40 PM
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
Title: Re: Product Height, Width and Weight Decimal Points
Post by: Milbo on January 29, 2017, 11:29:16 AM
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".
Title: Re: Product Height, Width and Weight Decimal Points
Post by: Milbo on January 29, 2017, 11:30:08 AM
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 :-)
Title: Re: Product Height, Width and Weight Decimal Points
Post by: atiart on February 01, 2017, 02:53:57 AM
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
Title: Re: Product Height, Width and Weight Decimal Points
Post by: Milbo on February 01, 2017, 10:44:51 AM
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
Title: Re: Product Height, Width and Weight Decimal Points
Post by: geertplovie on January 29, 2018, 19:56:29 PM
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!


Title: Re: Product Height, Width and Weight Decimal Points
Post by: Milbo on January 30, 2018, 14:52:03 PM
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.