Post by tim21701 » Fri Feb 25, 2011 6:21 pm

example:
Image
decided:
1.) in catalog/view/theme/default/template/product/product.tpl find:

Code: Select all

<td><b><?php echo $text_availability; ?></b></td>
<td><?php echo $stock; ?></td>
</tr>
after add:

Code: Select all

<tr>  
<td><b><?php echo $text_weight; ?></b></td>
 <td><?php echo $weight; ?></td> 
<tr>              
<?php if ($weight) { ?>
<tr>
<?php } ?>
2.) in catalog/controller/product/product.php after this:

Code: Select all

$this->data['text_price'] = $this->language->get('text_price');
add this:

Code: Select all

$this->data['text_weight'] = $this->language->get('text_weight');
(in this file) after:

Code: Select all

$this->data['model'] = $product_info['model'];
add:

Code: Select all

$this->data['weight'] = $product_info['weight'];
3.) In your file localization: catalog/language/english/product/product.php add this:

Code: Select all

$_['text_weight']               = 'Weight:';
(Item 3 - do with the rest of localization files) and joy.

Sorry for my bad English ;D
Last edited by tim21701 on Fri Mar 08, 2013 4:26 am, edited 1 time in total.

User avatar
Newbie

Posts

Joined
Fri Feb 25, 2011 5:46 pm
Location - Russia, Murmansk

Post by jeglash » Tue Oct 02, 2012 4:18 am

This worked beautifully for me, and saved me so much time! Thanks so much.

On a related note, I'm trying to display the Weight on the search results for each product, in between Name and Description. For the life of me, I can't figure this out and can't find anything on the forum related to it.

Could you help me out here? Again, many thanks. Joe

Joe Eglash
http://EglashCreative.com


User avatar
New member

Posts

Joined
Sun Sep 30, 2012 5:10 am
Location - Tulsa, Oklahoma, USA

Post by octhebest » Tue Sep 03, 2013 5:16 pm

Dear Tim,

Nice work.I am getting the result.But i need to see the weight option only on some products.

and product Dimensions.Can you please update me.

Newbie

Posts

Joined
Tue Jan 08, 2013 9:24 pm

Post by Deeco » Thu Dec 12, 2013 4:43 am

Hello,

First and foremost, I'm sorry to bump this old thread. I have implemented this mod, but I have one problem. The measurement of weight is not displayed beside the weight.

For example:

It is showing Weight: 800.0000
I need it to show: Weight: 800kg


Thank you.

Newbie

Posts

Joined
Thu Dec 12, 2013 4:41 am

Post by ramjiopencart » Fri Mar 14, 2014 3:27 pm

Hi I Con't able to find

<td><b><?php echo $text_availability; ?></b></td>
<td><?php echo $stock; ?></td>
</tr>

Plz Help Me

Newbie

Posts

Joined
Tue Mar 11, 2014 9:53 pm
Location - india

Post by ramjiopencart » Fri Mar 14, 2014 3:44 pm

I Got it .. but it displays As
500.0000000

Newbie

Posts

Joined
Tue Mar 11, 2014 9:53 pm
Location - india

Post by IP_CAM » Wed Mar 19, 2014 11:04 am

ramjiopencart wrote:Hi I Con't able to find

<td><b><?php echo $text_availability; ?></b></td>
<td><?php echo $stock; ?></td>
</tr>

Plz Help Me


In my OpenShop 1.6 /OC1.5.6.1)
it has to be entered as such::

<?php } ?>
<?php if ($weight) { ?>
<span><?php echo $text_weight; ?><span> <?php echo $weight; ?><br />
<?php } ?>

----------------

<div class="description">
<?php if ($manufacturer) { ?>
<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
<?php } ?>
<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
<?php if ($reward) { ?>
<span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
<?php } ?>
<?php if ($weight) { ?>
<span><?php echo $text_weight; ?><span> <?php echo $weight; ?><br />
<?php } ?>
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
<?php if ($price) { ?>
<div class="price"><?php echo $text_price; ?>
<?php if (!$special) { ?>
<?php echo $price; ?>
<?php } else { ?>
<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
<?php } ?>
<br />

-------------

I had no chance yet to test it, because I have no products online at this time, but I guess it should work.
All other files are similar to the installation guide..

Good Luck

Ernie

Ernie's OpenCart v.1.5.6.5 LIGHT + V-Pro + OpenShop Admin v.1.75 Test Sites
http://www.bigmax.ch - http://www.opencart.li/shop/
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by IP_CAM » Thu Mar 20, 2014 9:31 am

I solved my Problems, latest Update on the Theme here:

http://forum.opencart.com/viewtopic.php ... 27#p484527

Ernie
ipc.li/cart

Ernie's OpenCart v.1.5.6.5 LIGHT + V-Pro + OpenShop Admin v.1.75 Test Sites
http://www.bigmax.ch - http://www.opencart.li/shop/
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by dazzyweb » Sat Dec 27, 2014 7:39 am

Does anyone know if this works for opencart 2.0

I can't seem to get it to work.

Newbie

Posts

Joined
Thu Jan 16, 2014 8:01 pm

Post by dazzyweb » Sun Dec 28, 2014 2:22 am

I managed to get it working now with some slight alterations

Newbie

Posts

Joined
Thu Jan 16, 2014 8:01 pm

Post by anurag.mittal10 » Mon May 18, 2015 9:26 pm

Hi dazzyweb

I am also using the opencart 2.0 , can you please help me to display the product weight on category page and product page.

Thanks in Advance


Posts

Joined
Mon May 18, 2015 9:24 pm

Post by anurag.mittal10 » Wed May 20, 2015 8:21 pm

Hi I am also using opencart, please help me to display the weight on product page


Posts

Joined
Mon May 18, 2015 9:24 pm

Post by tomroguk » Thu Apr 07, 2016 5:36 am

Hi all,
I recently did this on my Opencart 2.0 site. Only thing I haven't tried yet is to get the weight class (kg,ounce etc) to show next to the weight entry.

Firstly go to:
/catalog/view/theme/yourtheme/template/product/product.tpl
Find where you want to add the label and price and insert:

Code: Select all

<?php echo $text_weight; ?>: <?php echo $weight; ?>
This will display Weight: Weight you enter in the admin for each product with weight class

/catalog/controller/product/product.php
Around line 245 I have:

Code: Select all

$data['text_loading'] = $this->language->get('text_loading');
I added:

Code: Select all

$data['text_weight'] = $this->language->get('text_weight');
Around line 270 I have:

Code: Select all

$data['model'] = $product_info['model'];
$data['reward'] = $product_info['reward'];
$data['points'] = $product_info['points'];
I added:

Code: Select all

$data['weight'] = $product_info['weight'];
/catalog/language/english/product/product.php
I then added this:

Code: Select all

$_['text_weight']			   = 'Weight';
This is not fully tested but on initial review it works well. Please try and adapt/post new code below.

Newbie

Posts

Joined
Sat Jun 08, 2013 4:28 am

Post by SChalice » Thu Apr 07, 2016 8:24 am

Wed Apr 06, 2016 3:36 pm

Amazing timing.

So we have to hack html to put in weights?

Can't wait for OpenCart version 9.0....

Newbie

Posts

Joined
Thu Apr 07, 2016 8:21 am

Post by tomroguk » Mon Apr 11, 2016 5:05 am

I am heavily customising my template to move things around which is why I needed some specific coding in this instance.

Newbie

Posts

Joined
Sat Jun 08, 2013 4:28 am

Post by hameed » Thu Sep 08, 2016 7:36 pm

i got weight .
-> i need to show it weight:30kg, but it displayed as weight:30.000000kg.
-> please help me how to remove this zeros

Newbie

Posts

Joined
Thu Sep 08, 2016 12:54 pm

Post by waqasbaberpk » Wed Jan 03, 2018 7:02 pm

i wan to see the product origin, weight option on product front page.
IP_CAM wrote:
Wed Mar 19, 2014 11:04 am
ramjiopencart wrote:Hi I Con't able to find

<td><b><?php echo $text_availability; ?></b></td>
<td><?php echo $stock; ?></td>
</tr>

Plz Help Me


In my OpenShop 1.6 /OC1.5.6.1)
it has to be entered as such::

<?php } ?>
<?php if ($weight) { ?>
<span><?php echo $text_weight; ?><span> <?php echo $weight; ?><br />
<?php } ?>

----------------

<div class="description">
<?php if ($manufacturer) { ?>
<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
<?php } ?>
<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
<?php if ($reward) { ?>
<span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
<?php } ?>
<?php if ($weight) { ?>
<span><?php echo $text_weight; ?><span> <?php echo $weight; ?><br />
<?php } ?>
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
<?php if ($price) { ?>
<div class="price"><?php echo $text_price; ?>
<?php if (!$special) { ?>
<?php echo $price; ?>
<?php } else { ?>
<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
<?php } ?>
<br />

-------------

I had no chance yet to test it, because I have no products online at this time, but I guess it should work.
All other files are similar to the installation guide..

Good Luck

Ernie

Newbie

Posts

Joined
Thu Dec 21, 2017 8:14 pm

Post by IP_CAM » Thu Jan 04, 2018 2:40 am

i wan to see the product origin, weight option on product front page.
please explain, what this is supposed to mean, what is a product origin, and is it about
displaying the product weight, or several weight options, on the Product Page? And what
OC Version and Theme is involved in this? At best show a link to the Site as well, if you
expect a usable reply. 8)
Ernie

Ernie's OpenCart v.1.5.6.5 LIGHT + V-Pro + OpenShop Admin v.1.75 Test Sites
http://www.bigmax.ch - http://www.opencart.li/shop/
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 3 guests