Post by labyrinth2061 » Tue Jan 17, 2012 2:50 am

How do i display the model in the http://***.com/cart/index.php?route=product/category&path=6
page? I see how to display it when in the product page itself but not how to display it underneath the thumbnails when in grid view.

Thanks

Newbie

Posts

Joined
Wed Sep 07, 2011 12:53 am

Post by OpenCart Addons » Tue Jan 17, 2012 3:13 am

Hey,

In catalog / view / theme / <your theme> / product / category.tpl
Put The Values:

Code: Select all

<?php echo $product['model']; ?>
<?php echo $product['upc']; ?>
Anywhere After:

Code: Select all

<?php foreach ($products as $product) { ?>
Example:
Find:

Code: Select all

<?php if ($product['thumb']) { ?>
      <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
      <?php } ?>
Add After:

Code: Select all

<div class="name"><?php echo $product['model']; ?></div>
<div class="name"><?php echo $product['upc']; ?></div>
Regards,
Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by nudylady » Sun Feb 26, 2012 4:06 am

OpenCart Addons wrote:Hey,
Example:
Find:

Code: Select all

<?php if ($product['thumb']) { ?>
      <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
      <?php } ?>
Add After:

Code: Select all

<div class="name"><?php echo $product['model']; ?></div>
<div class="name"><?php echo $product['upc']; ?></div>
Regards,
Joel.
code above not work in my case. Only some products have upc.
I tried this also not work

Code: Select all

<?php if ($product['upc']) { ?>
      <div class="name"><?php echo $product['upc']; ?></div>
      <?php } ?>

In both cases it gives an error undecleard upc in category.tpl

New member

Posts

Joined
Sun Feb 19, 2012 12:14 am

Post by uksitebuilder » Wed Feb 29, 2012 2:44 am

you also need to declare the variables in catalog/controller/product/category.php

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by labyrinth2061 » Tue Mar 27, 2012 1:28 am

Simon, thank you for that. What do I add to declare those variables?

Thanks

uksitebuilder wrote:you also need to declare the variables in catalog/controller/product/category.php

Newbie

Posts

Joined
Wed Sep 07, 2011 12:53 am
Who is online

Users browsing this forum: Google [Bot], stefansmith129 and 208 guests