Would it be possible to hide decimal weight of the product?
Sorry for my English
[attachment cleanup by admin]
Anyone can help me?
thanks
Hi, I think I have the same issue..know this topic is old, if you want I can create a new one, but it's the exact same problem
this has been asked and I have answered at least twice
last time
simple php for what ever the display is
do
$weight = number_format($weight,2);
echo $weight;
Yes I read that, but still the same problem as the other user;
I don't understand where I should put this string, have been opening many css but even with firebug can't grasp it
You have to do this in a product details page override
Look in the forum on how to do overrides
views/productdetails/default.php
after this
<div class="productdetails-view productdetails">
add this
<?php
$this->product->product_weight = number_format($this->product->product_weight,2);
?>
Thanks, your help is greatly appreciated. Yet, I keep having the same issue, the numbers keep on showing like this
http://www.toelettaroma.it/index.php/shop2/cani/alimentazione/cuccioli-fino-a-4-5-mesi
Actually I went in
Components/com_virtuemart/views/productdetails/tmpl/default.php
added the string
<?php $weight = number_format($weight,2);
echo $weight;
?>
but nothing changed
tried with this, thought it seems strange, and still nothing happened
<?php
$this->product->product_weight = number_format($this->product->product_weight,2);
?>
tried to change it to
<?php
$this->product->product_weight = number_format(weight,2);
?>
but still unchanged
sorry bothering!
Also in the backend, when I save with "1" as soon as I reopen the product it gives 1.0000 right away!
this isn't even the weight!!!!!!
it is your custom fields I assume your talking about..
search for custom fields display
Yes, it's the weight, and then the custom field is linked to the weight!
Here's the backend screenshot
https://www.dropbox.com/s/fpm9bvxnwcz0fmw/Screenshot%202015-12-23%2012.54.37.png?dl=0
Quote from: Piccolopoeta on December 23, 2015, 12:02:37 PM
Thanks, your help is greatly appreciated. Yet, I keep having the same issue, the numbers keep on showing like this
http://www.toelettaroma.it/index.php/shop2/cani/alimentazione/cuccioli-fino-a-4-5-mesi
Actually I went in
Components/com_virtuemart/views/productdetails/tmpl/default.php
added the string
<?php $weight = number_format($weight,2);
echo $weight;
?>
but nothing changed
tried with this, thought it seems strange, and still nothing happened
<?php
$this->product->product_weight = number_format($this->product->product_weight,2);
?>
tried to change it to
<?php
$this->product->product_weight = number_format(weight,2);
?>
but still unchanged
sorry bothering!
Also in the backend, when I save with "1" as soon as I reopen the product it gives 1.0000 right away!
thats not the product page.
Its the category
Uh..but it's just the same in the product details, see?
http://www.toelettaroma.it/index.php/shop2/cani/alimentazione/cuccioli-fino-a-4-5-mesi/primi-mesi-bufalo-detail
I get the same problem when i edit the product via administration. Even if I write "1" in the product weight, as soon as I save, it turns to "1.000"!
just change the display as above.. it will ALWAYS be stored as 1.0000 .. doesn't need to be displayed as..
enuf info above to achieve this
Quote from: Piccolopoeta on January 14, 2016, 11:38:50 AM
Uh..but it's just the same in the product details, see?
http://www.toelettaroma.it/index.php/shop2/cani/alimentazione/cuccioli-fino-a-4-5-mesi/primi-mesi-bufalo-detail
I get the same problem when i edit the product via administration. Even if I write "1" in the product weight, as soon as I save, it turns to "1.000"!
this is tested for product details page.
This removed the decimals
<?php
$this->product->product_weight = number_format($this->product->product_weight,0);
echo $this->product->product_weight;
?>
THEN: on the category page this is tested and working
<?php
$product->product_weight = number_format($product->product_weight,0);
echo $product->product_weight;
?>