Post by MrSkins » Mon May 03, 2010 12:00 am

Hi all, Has anyone produced a module to display weight and / or dimensions on product. I have listed dimensions in the product field but nowhere seems to display these?

Can anyone help?

Big thanks

http://www.crystalcornucopia.co.uk


New member

Posts

Joined
Tue Feb 02, 2010 8:06 pm
Location - UK

Post by MrSkins » Fri May 07, 2010 3:47 am

Ideas anyone?

:)

http://www.crystalcornucopia.co.uk


New member

Posts

Joined
Tue Feb 02, 2010 8:06 pm
Location - UK

Post by Qphoria » Fri May 07, 2010 4:32 am

You can add them easily to the view

1. EDIT: catalog/view/theme/default/template/product/product.tpl

2. FIND:

Code: Select all

<tr>
  <td><b><?php echo $text_model; ?></b></td>
  <td><?php echo $model; ?></td>
</tr>
3. AFTER, ADD:

Code: Select all

<tr>
  <td><b>Weight:</b></td>
  <td><?php echo $this->weight->format($product_info['weight'], 'lb'); ?></td>
</tr>
<?php if ($product_info['length'] && $product_info['width'] && $product_info['height']) { ?>
<tr>
  <td><b>Dimensions:</b></td>
  <td><?php echo $product_info['length']; ?> x <?php echo $product_info['width']; ?> x <?php echo $product_info['height']; ?></td>
</tr>
<?php } ?>

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by MrSkins » Fri May 07, 2010 4:46 am

Big thanks Q that worked a treat..

http://www.crystalcornucopia.co.uk


New member

Posts

Joined
Tue Feb 02, 2010 8:06 pm
Location - UK

Post by Eveline » Sun May 09, 2010 12:12 am

Hi,

I got it to work thanks.

However if you leave the fields blank it shows like 0.00 x 0.00 x 0.00

How do i get it to work like L 0 <length class> x W 0 <length class> H 0<length class> (with prefex letter) and leave out fields that aren't filled it? I usually only give the height of an items sometimes width to. So it'll show like H 15 cm x w 10 cm or just H 15 cm if that's all data thats given

That would make this code even better :)

New member

Posts

Joined
Sat May 01, 2010 12:05 am

Post by Qphoria » Sun May 09, 2010 9:09 am

Meant for 1.4.7 or later

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Sun May 09, 2010 9:56 pm

No Eveline. I didn't mean you. I was replying to dramony. If you want L W H to show then you can add that

Code: Select all

<tr>
  <td><b>Dimensions:</b></td>
  <td>L: <?php echo $product_info['length']; ?> W: <?php echo $product_info['width']; ?> H: <?php echo $product_info['height']; ?></td>
</tr>

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by doremi » Fri May 14, 2010 4:14 pm

Hi, what if I want to show the weight or dimension in two units i.e. lbs and g, and inch and cm? e.g.

Weight: 2.2lbs (1000g)
Dimension: 1x1x2inch (2.5x2.5x5.1cm)

how do i write the code so that I take the weight and dimension I entered for the product and divide by or multiply with the necessary conversion factor?

Thank you for your help!

New member

Posts

Joined
Thu May 13, 2010 11:58 pm

Post by Affableaardvark » Wed Jul 07, 2010 10:47 pm

Thank you for the above advice!
One little question. When the dimension shows it is in the format xxx.xx my site is in metric so instead of 450 i get 450.00 Is there a way of losing the extra zeroes?
Example here http://www.containers.org.uk/plastic/DH641002AA

Thank you for the excellent software!! :crazy:

User avatar

Posts

Joined
Thu Apr 01, 2010 11:19 pm

Post by Affableaardvark » Thu Jul 08, 2010 11:29 pm

Found a solution that may be of interest to others.
My sitehttp://www.containers.org.uk/ now has a dimension search in a module where the customer can provide minimum and maximum values.
The module was programmed in a couple of hours by Jay Gilford
http://www.jaygilford.com/ should anyone else need the same service.
I can recommend his work!

User avatar

Posts

Joined
Thu Apr 01, 2010 11:19 pm

Post by sabonsai » Tue Oct 26, 2010 7:20 pm

Qphoria wrote:You can add them easily to the view

1. EDIT: catalog/view/theme/default/template/product/product.tpl

2. FIND:

Code: Select all

<tr>
  <td><b><?php echo $text_model; ?></b></td>
  <td><?php echo $model; ?></td>
</tr>
3. AFTER, ADD:

Code: Select all

<tr>
  <td><b>Weight:</b></td>
  <td><?php echo $this->weight->format($product_info['weight'], 'lb'); ?></td>
</tr>
<tr>
  <td><b>Dimensions:</b></td>
  <td><?php echo $product_info['length']; ?> x <?php echo $product_info['width']; ?> x <?php echo $product_info['height']; ?></td>
</tr>
I have changed my file now I get the following error please help to fix, I'm not a programmer
Model: Cascade Pot Small_001
Weight: Notice: Undefined variable: product_info in /var/www/b/bo/bonsaiart.co.za/catalog/view/theme/default/template/product/product.tpl on line 37Notice: Undefined index: lb in /var/www/b/bo/bonsaiart.co.za/system/library/weight.php on line 350.00
Dimensions: Notice: Undefined variable: product_info in /var/www/b/bo/bonsaiart.co.za/catalog/view/theme/default/template/product/product.tpl on line 41 x Notice: Undefined variable: product_info in /var/www/b/bo/bonsaiart.co.za/catalog/view/theme/default/template/product/product.tpl on line 41 x Notice: Undefined variable: product_info in /var/www/b/bo/bonsaiart.co.za/catalog/view/theme/default/template/product/product.tpl on line 41

Newbie

Posts

Joined
Tue Oct 26, 2010 6:49 pm

Post by kianograph » Sun Nov 14, 2010 4:47 pm

Affableaardvark wrote:Thank you for the above advice!
One little question. When the dimension shows it is in the format xxx.xx my site is in metric so instead of 450 i get 450.00 Is there a way of losing the extra zeroes?
Example here http://www.containers.org.uk/plastic/DH641002AA

Thank you for the excellent software!! :crazy:
Thats my problem too PLZZZZZZZZZZZZZZ !!!!
Help meeeeeee

Newbie

Posts

Joined
Sun Sep 12, 2010 2:45 pm
Who is online

Users browsing this forum: No registered users and 109 guests