Page 1 of 1

How to add weight to your product page

Posted: Wed Dec 31, 2014 11:22 pm
by techttz
Add this in "catalog/controller/product/product.php" add these lines
Find

Code: Select all

$data['text_reward'] = $this->language->get('text_reward');
put this code after

Code: Select all

$data['text_weight'] = $this->language->get('text_weight');
Find

Code: Select all

$data['reward'] = $product_info['reward'];
put this code after

Code: Select all

$data['weight'] = $product_info['weight'];
Add this in "catalog/view/theme/default/template/product/product.tpl"
Find

Code: Select all

<h2><?php echo $price; ?></h2>
put this code after

Code: Select all

Weight: <?php echo $weight; ?>

Re: How to add weight to your product page

Posted: Thu Jan 01, 2015 10:36 am
by IP_CAM
Should not be hard, a Quick XML-Mod would be helpful for many, I guess...

Re: How to add weight to your product page

Posted: Tue Feb 17, 2015 6:52 pm
by gauravbora2008
Works perfectly!

To make it look better, how can I show the weight unit with weight and strip out decimal zeroes
like 500g instead of 500.00000000 (as it is currently showing)

Thanks alot!

Re: How to add weight to your product page

Posted: Wed Feb 18, 2015 10:03 pm
by gauravbora2008
Works Perfectly !

To make it look better... can anybody help me with this?

Right now it is visible as 50.0000000

I want to show it as 50g

How can I do this?

Any help is much appreciated...
thanks

Re: How to add weight to your product page

Posted: Thu Feb 19, 2015 12:08 am
by IP_CAM
check Google, there are several infos on this:
  • Remove decimals weight site.opencart.com
  • Remove decimals (Dimensions) site:forum.opencart.com
This OpenShop Extension could possibly do it for you:
http://openshop.org.ua/docs

Ernie
openshop.li/shop/

Re: How to add weight to your product page

Posted: Tue May 12, 2015 2:27 am
by atrane
NM, I figured it out. All of the changes need to be made in the system/modification/[address] that you have listed. Sorry for the post.

I figured out how to change the multiple 0's at the end of the weight by going into your OC database-> products table-> weight, under the length, it was set to (15,8), so I changed it to (15,2) success!

Thanks

Re: How to add weight to your product page

Posted: Tue May 12, 2015 9:02 am
by IP_CAM
atrane wrote:.. change the multiple 0's at the end of the weight by going into your OC database-> products table-> weight, under the length, it was set to (15,8), so I changed it to (15,2) success!
Good for you!
Good Luck
Ernie

Re: How to add weight to your product page

Posted: Tue May 12, 2015 7:22 pm
by Flysan
It work perfectly thanks but how to add the symbol of the weight after the number?

Re: How to add weight to your product page

Posted: Fri May 22, 2015 4:50 am
by Pobb
To include the weight suffix, edit your product.php and instead of:

Code: Select all

$data['weight'] = $product_info['weight'];


try putting:

Code: Select all

$data['weight'] = $this->weight->format($product_info['weight'], $product_info['weight_class_id']);

Re: How to add weight to your product page

Posted: Fri Jul 10, 2015 6:39 am
by Flysan
How to make it work in the category page?

Re: How to add weight to your product page

Posted: Fri Jul 10, 2015 8:46 pm
by viethemes
Flysan wrote:How to make it work in the category page?
I have create a VQMOD extension for that. If you are using VQMOD, you can install this extension https://www.dropbox.com/s/wlhy7mi8dbrln ... t.xml?dl=0.