Post by naser » Sun Mar 27, 2011 8:05 am

Hi, am new to opencart can please tell me how to add a link in column_left or right that only will show in an individual product page? so that link or picture only shows in the page I want.
i used
<?php if ( ($Path = '35') ) { echo 'SOMETHING'; } ?>
but not working
Last edited by naser on Tue Mar 29, 2011 4:09 am, edited 1 time in total.

Newbie

Posts

Joined
Sun Mar 27, 2011 7:48 am

Post by qahar » Sun Mar 27, 2011 2:33 pm

does you define $this->data[path] on controller/common/column_left.php

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by naser » Sun Mar 27, 2011 10:55 pm

ty qahar can i know how to make it show only in one product page i did this in column_left

<?php if($this->request->get['route'] == 'product/product' ){ ?>
<td <img alt="" src="catalog/view/theme/default/image/check.gif" /></td>
<?php } ?>
but this code will show it in all product pages i want it only in page product_id=49

Newbie

Posts

Joined
Sun Mar 27, 2011 7:48 am

Post by openmycart.com » Mon Mar 28, 2011 12:26 am

doesn't as follow solved it?

Code: Select all

<?php if (($this->request->get['route'] == 'product/product' ) && ($product_id ==48)){ ?>
<td> <img alt="" src="catalog/view/theme/default/image/check.gif" /></td>
<?php } ?>

Find and get many various of opencart modules, themes, mods, etc for your opencart store at http://www.openmycart.com/oc/, OPENCART SITE customization and Maintenance supports at here


User avatar
Active Member

Posts

Joined
Tue Oct 12, 2010 4:47 am


Post by naser » Mon Mar 28, 2011 1:15 am

ty openmycart.com
in catalog/view/theme/default/template/common/column_left

Code: Select all

<?php if (($this->request->get['route'] == 'product/product' ) && ('$product_id ==49')){ ?>
<td> <img alt="" src="catalog/view/theme/default/image/check.gif" /></td>
<?php } ?> 
sry not solved same thing it will show in all product pages i want it only in page product_id=49

Newbie

Posts

Joined
Sun Mar 27, 2011 7:48 am

Post by openmycart.com » Mon Mar 28, 2011 5:47 pm

OK, if I am not miss understood You are looking as follow:

Code: Select all

<?php if ($this->request->get['route'] == 'product/product&'.$product_id.'=48' /* Your product id */){  ?>
<td> <img alt="" src="catalog/view/theme/default/image/check.gif" /></td>
<?php } ?>
am I still fail to catch it?

Find and get many various of opencart modules, themes, mods, etc for your opencart store at http://www.openmycart.com/oc/, OPENCART SITE customization and Maintenance supports at here


User avatar
Active Member

Posts

Joined
Tue Oct 12, 2010 4:47 am


Post by naser » Tue Mar 29, 2011 3:59 am

big thx to Khalid H.S he solved it and now it's working great,
thank you openmycart and qahar for ur help. and please if u can check the code will be nice
here how

in catalog\view\theme\default\template\common\column_left.tpl
add this code

Code: Select all

<?php if ($product_id ==49) { ?>
<td><img alt="" src="catalog/view/theme/default/image/check.gif" /></td>
<?php } ?>
in catalog\controller\common\column_left.php
look for

Code: Select all

$this->data['modules'] = $module_data;
under it put this code

Code: Select all

if (isset($this->request->get['product_id'])) {
$this->data['product_id'] = $this->request->get['product_id'];
} else {
$this->data['product_id'] = 0;
}
product_id ==49 you can change it to any page u want.

Newbie

Posts

Joined
Sun Mar 27, 2011 7:48 am

Post by rwalker » Mon Mar 18, 2013 12:03 pm

If you wanted this for multiple product pages can you just seperate the IDs with commas? Ie 49,50,51


Thank you

Discount Golf Clubs and Golf Equipment - Powered by Opencart


New member

Posts

Joined
Fri Jul 01, 2011 8:14 am
Who is online

Users browsing this forum: No registered users and 72 guests