Page 1 of 6

Product Dimensions (L x W x H)

Posted: Tue Oct 26, 2010 6:51 pm
by sabonsai
Please help I have searched now for a few hours and can not find a way to add the product dimensions on the product page for my clients to see the product dimensions (L x W x H) I need to display this in the product page if a client view a product, look at this link http://www.bonsaiart.co.za/index.php?ro ... uct_id=134 you notice you can not see any dimensions PLEASE help.

Re: Product Dimensions (L x W x H)

Posted: Tue Oct 26, 2010 10:24 pm
by mystifier
Your site is not running at the moment however: Length, Width and Height may be set for a Product but as far as I know, these are never displayed anywhere, they are simply used to calculate shipping in some shipping options.

If you want to show them, you will have to add the fields to product.tpl or include the dimensions in the Product Description.

Re: Product Dimensions (L x W x H)

Posted: Thu Jan 06, 2011 10:58 pm
by steroyle
I had the same problem and fixed it by doing the following

/catalog/view/theme/default/template/product/product.tpl

Add this code at around line 35 to add a new table row for the dimensions:

Code: Select all

<tr>
	<td><strong>Size (L x W x H) cm</strong></td>
	<td><?php echo $length . " x " . $width . " x " . $height; ?></td>
</tr>
/catalog/controller/product/product.php

Fine this line:

Code: Select all

$this->data['heading_title'] = $product_info['name'];
Add this below:

Code: Select all

$this->data['length'] = $product_info['length'];
$this->data['width'] = $product_info['width'];
$this->data['height'] = $product_info['height'];

Re: Product Dimensions (L x W x H)

Posted: Wed Jan 11, 2012 10:17 pm
by Chiel
Thanks a lot steroyle! Achieving this with your help made my day.

Re: Product Dimensions (L x W x H)

Posted: Sun Jan 15, 2012 10:59 pm
by filippota
thanks steroyle. this works in 1.5.1.3 well. but could you help to add unit after all measures. like: 10 cm x 20 cm x 30 cm

Re: Product Dimensions (L x W x H)

Posted: Sun Jan 15, 2012 11:07 pm
by straightlight
VQMod version ready so not to override core files regarding the controller modifications.

Re: Product Dimensions (L x W x H)

Posted: Sun Jan 15, 2012 11:27 pm
by filippota
straightlight. could you make this mod to show Units as well after lenght, width height?

Re: Product Dimensions (L x W x H)

Posted: Sun Jan 15, 2012 11:48 pm
by straightlight
It is kind of odd that your last request was added into the compare products but not to the product details itself ... modifications above completed. You may now use: the $product['width'], $product['height'], $product['weight'] and $product['length'] from product.tpl during the loop call. ;)

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 12:10 am
by filippota
straightlight: thanks for quick feedback. doesnt work for me though. what OC version is it supposed to work with?

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 12:18 am
by straightlight
As mentioned on the XML file, v1.5.1.3. Could you elaborate the doesn't work ?

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 12:21 am
by filippota
undefined variable length .... also undefined variable width and height

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 12:27 am
by filippota
i uploaded your xml to vqmod folder and changed default template template.tpl added <?php echo $length . " x " . $width . " x " . $height; ?>

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 12:36 am
by straightlight
As specified above, all fours must be used with: $product['length'], $product['width'], $product['height'] and $product['weight'] inside the loop call so, in your case, it would be:

Code: Select all

<?php echo $product['length'] . " x " . $product['width'] . " x " . $product['height']; ?>

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 12:49 am
by filippota
ok. now the error says : Notice: Undefined variable: product in /www/apache/domains/www...

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 12:54 am
by straightlight
Please post your product.tpl file as an attachment.

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 12:57 am
by filippota
tpl attached

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 1:10 am
by straightlight
XML file above updated so to match with your product.tpl file as well as your product.tpl on this attachment.

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 1:29 am
by filippota
straightlight: really sorry but nothing seems to work. i've checked all chmod persmissions. could you please check the attached controller/product/product.php .

Notice: Undefined variable: text_dimension in /www/apache/domains/
also errors for:

Notice: Undefined variable: product in /www/apache/domains/www.

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 2:09 am
by straightlight
XML file updated on the above. Remove the last change from your TPL file this time.

Re: Product Dimensions (L x W x H)

Posted: Mon Jan 16, 2012 2:28 am
by filippota
straightlight. thanks for all that help! no success and i am guessing theres is something going on with the files permissions in vqcache folder. i cannot change files permissions in that folder to 777. all files in that vqache folder are chmod 644.