Support Team
posted this
02 May 2017
Hi,
I need to display the dimensions of the product (lenght / weight / height ...)
I've found the following manual solution:
Product Weight
<?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 } ?>
PRODUCT LENGTH
<?php //Product Length
if (!(($this->product->product_length)==0)) { ?>
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_LENGTH') ?>
<strong>
<?php echo floor($this->product->product_length) ?></strong>
</br>
<?php } ?>
PRODUCT WIDTH
<?php //Product Width
if (!(($this->product->product_width)==0)) { ?>
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_WIDTH') ?>
<strong>
<?php echo floor($this->product->product_width) ?></strong>
</br>
<?php } ?>
PRODUCT HEIGHT
<?php //Product Height
if (!(($this->product->product_height)==0)) { ?>
<span class="product-fields-title" >
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_HEIGHT') ?>
</span>
<?php echo floor($this->product->product_height) ?>
</br>
<?php } ?>
All custom PHP can be added to the CMS CODE control (Insert tab >> More). Add this control to the place where you want the result to appear.
This is for Product Details template.
AND as well the "Reference" of the product (as many products are similar).
Do you mean product SKU? If so please find custom code here:
http://answers.themler.com/articles/67028/tips-and-tricks#t_2
Thank you,
Olivia
Hi,
> I need to display the dimensions of the product (lenght / weight / height ...)
I've found the following manual solution:
Product Weight
`<?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 } ?>`
PRODUCT LENGTH
`<?php //Product Length
if (!(($this->product->product_length)==0)) { ?>
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_LENGTH') ?>
<strong>
<?php echo floor($this->product->product_length) ?></strong>
</br>
<?php } ?>`
PRODUCT WIDTH
`<?php //Product Width
if (!(($this->product->product_width)==0)) { ?>
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_WIDTH') ?>
<strong>
<?php echo floor($this->product->product_width) ?></strong>
</br>
<?php } ?>`
PRODUCT HEIGHT
`<?php //Product Height
if (!(($this->product->product_height)==0)) { ?>
<span class="product-fields-title" >
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_HEIGHT') ?>
</span>
<?php echo floor($this->product->product_height) ?>
</br>
<?php } ?>`
All custom PHP can be added to the CMS CODE control (Insert tab >> More). Add this control to the place where you want the result to appear.
This is for Product Details template.
> AND as well the "Reference" of the product (as many products are similar).
Do you mean product SKU? If so please find custom code here:
http://answers.themler.com/articles/67028/tips-and-tricks#t_2
Thank you,
Olivia