There is a section "Product dimensions and weight", but inputed data don't displays on the page "Product Details".
Please help with the code for displaying all fields of the section (if they entered) "productdetails\tmpl\default.php"
I found answer by myself. Sorry for disturbing:
<?php //Product Weight
if (!(($this->product->product_weight)==0)) { ?>
<span class="product-fields-title" >
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_WEIGHT') ?>
</span>
<?php echo $this->product->product_weight ?>
</br>
<?php } ?>
<?php //Product Length
if (!(($this->product->product_length)==0)) { ?>
<span class="product-fields-title" >
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_LENGTH') ?>
</span>
<?php echo $this->product->product_length ?>
</br>
<?php } ?>
<?php //Product Width
if (!(($this->product->product_width)==0)) { ?>
<span class="product-fields-title" >
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_WIDTH') ?>
</span>
<?php echo $this->product->product_width ?>
</br>
<?php } ?>
<?php //Product Height
if (!(($this->product->product_height)==0)) { ?>
<span class="product-fields-title" >
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_HEIGHT') ?>
</span>
<?php echo $this->product->product_height ?>
</br>
<?php } ?>
Thank you for posting your answer -- it's just what I was looking for. It took me a bit to find the file to revise:
com_virtuemart/productdetails/tmpl/default.php. I moved a copy to my template override folder. Worked great.
http://forum.virtuemart.net/index.php?topic=92756.0
I have been able to do this via the template override as put forward by BanquetTables.pro... BUT ..
How do I limit the amount of decimal places? Current it displays 4 and I have been trolling to find a way to format the output but to no avail.
ANY suggest greatly appreciated!
Hello,
Quote from: lumieres on June 08, 2012, 05:27:52 AM
How do I limit the amount of decimal places?
try this:
<?php
// $this->product->product_length=1234.5678;
// english notation without thousands separator
echo number_format($this->product->product_length, 2, '.', '');
// 1234.57
?>
Legend! Absolutely brilliant SamF,
Been trying similar things for about 3 hours... and couldn't get it.
Greatly Appreciated.
Quote from: SamF on June 08, 2012, 07:44:05 AM
Hello,
Quote from: lumieres on June 08, 2012, 05:27:52 AM
How do I limit the amount of decimal places?
try this:
<?php
// $this->product->product_length=1234.5678;
// english notation without thousands separator
echo number_format($this->product->product_length, 2, '.', '');
// 1234.57
?>
Sorry,
which file is this?
Thanks in advance
Joomla 2.5.25
VM 2.6.10
It's no where - i.e. where ever your displaying your weights etc
<?php echo number_format($this->product->product_weight, 2, '.', ''); ?>