Post by sabonsai » Tue Oct 26, 2010 6:51 pm

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.

Newbie

Posts

Joined
Tue Oct 26, 2010 6:49 pm

Post by mystifier » Tue Oct 26, 2010 10:24 pm

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.

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by steroyle » Thu Jan 06, 2011 10:58 pm

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'];

Newbie

Posts

Joined
Thu Jan 06, 2011 10:50 pm

Post by Chiel » Wed Jan 11, 2012 10:17 pm

Thanks a lot steroyle! Achieving this with your help made my day.

Newbie

Posts

Joined
Wed Jan 11, 2012 10:16 pm

Post by filippota » Sun Jan 15, 2012 10:59 pm

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
Last edited by filippota on Sun Jan 15, 2012 11:25 pm, edited 1 time in total.

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm

Post by straightlight » Sun Jan 15, 2012 11:07 pm

VQMod version ready so not to override core files regarding the controller modifications.

Attachments

opencart_product_dimension_1.PNG

v1.5.2.1 - opencart_product_dimension_1.PNG (83.86 KiB) Viewed 16558 times

opencart_product_dimension_2.PNG

v1.5.2.1 - opencart_product_dimension_2.PNG (23.99 KiB) Viewed 16567 times

Last edited by straightlight on Mon Mar 12, 2012 8:51 pm, edited 7 times in total.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by filippota » Sun Jan 15, 2012 11:27 pm

straightlight. could you make this mod to show Units as well after lenght, width height?

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm

Post by straightlight » Sun Jan 15, 2012 11:48 pm

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

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by filippota » Mon Jan 16, 2012 12:10 am

straightlight: thanks for quick feedback. doesnt work for me though. what OC version is it supposed to work with?

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm

Post by straightlight » Mon Jan 16, 2012 12:18 am

As mentioned on the XML file, v1.5.1.3. Could you elaborate the doesn't work ?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by filippota » Mon Jan 16, 2012 12:21 am

undefined variable length .... also undefined variable width and height

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm

Post by filippota » Mon Jan 16, 2012 12:27 am

i uploaded your xml to vqmod folder and changed default template template.tpl added <?php echo $length . " x " . $width . " x " . $height; ?>

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm

Post by straightlight » Mon Jan 16, 2012 12:36 am

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']; ?>

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by filippota » Mon Jan 16, 2012 12:49 am

ok. now the error says : Notice: Undefined variable: product in /www/apache/domains/www...

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm

Post by straightlight » Mon Jan 16, 2012 12:54 am

Please post your product.tpl file as an attachment.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by filippota » Mon Jan 16, 2012 12:57 am

tpl attached

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm

Post by straightlight » Mon Jan 16, 2012 1:10 am

XML file above updated so to match with your product.tpl file as well as your product.tpl on this attachment.

Attachments


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by filippota » Mon Jan 16, 2012 1:29 am

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.

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm

Post by straightlight » Mon Jan 16, 2012 2:09 am

XML file updated on the above. Remove the last change from your TPL file this time.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by filippota » Mon Jan 16, 2012 2:28 am

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.

New member

Posts

Joined
Sun Jan 15, 2012 10:23 pm
Who is online

Users browsing this forum: No registered users and 81 guests