News:

Support the VirtueMart project and become a member

Main Menu

Displaying of Product dimensions (weight, size, unit measure)

Started by Chinas, February 11, 2012, 12:05:30 PM

Previous topic - Next topic

Chinas

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"

Chinas

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 ?>

anotart

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.



lumieres

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!

SamF

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_length2'.''');

// 1234.57

?>


lumieres

Legend!  Absolutely brilliant SamF,

Been trying similar things for about 3 hours... and couldn't get it.

Greatly Appreciated.

kelecz

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_length2'.''');

// 1234.57

?>



Sorry,

which file is this?

Thanks in advance

Joomla 2.5.25
VM 2.6.10

GJC Web Design

It's no where - i.e. where ever your displaying your weights etc

<?php echo number_format($this->product->product_weight2'.'''); ?>
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation