Post by dellasys » Fri Mar 16, 2012 9:58 am

I'm a newbie to opencart .So ,can anyone may teach me how to display weight and weight unit in the featured box beside the price .I knew need to add somethings like <?php echo $weight ; ?> but it displays nothing. Appreciate for your help .

New member

Posts

Joined
Thu Mar 01, 2012 1:44 pm

Post by dellasys » Sat Mar 17, 2012 11:35 am

Jeremy Fisk wrote:you will first have to grab it in the controler
Can you please teach me step by step ?? i cant do this :( .. thank you a lot ...

New member

Posts

Joined
Thu Mar 01, 2012 1:44 pm

Post by dellasys » Tue Mar 20, 2012 8:16 am

I solved the problem above.And i'm glad that i can share somethings here to help others.
catalog/controller/module/featured.php
After

Code: Select all

$this->data['products'][] = array(
Add this

Code: Select all

'weight'         => $product_info['weight'],
	  'weight_class'   => $product_info['weight_class'],
Go to catalog/view/theme/default/template/module/featured.tpl

After

Code: Select all

<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
line11

Add this

Code: Select all

(<?php echo $product['weight']; ?><?php echo $product['weight_class']; ?> )
should be ok :)

New member

Posts

Joined
Thu Mar 01, 2012 1:44 pm

Post by Flysan » Thu Aug 13, 2015 10:24 pm

I try on OC 2.0.2.0 but it doesn't work...how to make it work?

New member

Posts

Joined
Tue Apr 28, 2015 6:25 pm
Who is online

Users browsing this forum: No registered users and 92 guests