Home - Help & Support - Contact Us
    

How To Link The OsCommerce Template Banners To A Specific Category Or Product

Any osCommerce template can contain banners in the header and side columns. The template's programmer often links them to a category, new products, specials listing and so on.

You may want to link them to your own category or to your own featured products. It's not difficult to do. First you need to locate where this banner is coded. That is to locate a specific file. If the banner is located in the header most likely this banner can be found in the /includes/header.php file. If the banner is located in one of the side columns look for it in the /inludes/column_left.php or /inludes/column_right.php files.

If you have difficulties in locating the place where the banner is coded here are some tips for you:
- in your browser right-click (Ctrl-click on Mac) the image of the banner and select Properties (in Safari you can use "Open Image in New Window" instead).
- See the name of this image (e.g. banner1.gif)
- Use the search functionality of your file manager or search tools like http://www.sowsoft.com/search.htm.
- Having located the file, you can now search for the line where this image is sitting. Very often it's Ctrl+F key stroke in any text editor.

You may see a line of code like this:


<a href="<?php echo tep_href_link('products_new.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'banner1.gif')?></a>


What you do after that is replacing the parameter for the tep_href_link() function for your own.

1. Linking to a category

Your code should look like this


<a href="<?php echo tep_href_link('index.php?cPath=1')?>"><?php echo tep_image(DIR_WS_IMAGES.'banner1.gif')?></a>
 

Use your own value of cPath. You can get this value while you are browsing the category you are going to link to. Just take a look at the address bar of your browser and you'll see the cPath value the current category has got.

2. Linking to a product

Your code should look like this


<a href="<?php echo tep_href_link('index.php?products_id=10')?>"><?php echo tep_image(DIR_WS_IMAGES.'banner1.gif')?></a>
 

Use your own value of products_id. You can get this value while you are browsing the product page you are going to link to. Take a look at the address bar of your browser and you'll see the products_id value of the current product.

3. Linking to the New Products, Specials is even easier

It's enough to use a code like this


<a href="<?php echo tep_href_link('products_new.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'banner1.gif')?></a>
<a href="<?php echo tep_href_link('specials.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'banner1.gif')?></a>


osCommerce Templates
Rated:NR/0 Votes
18135 Views
More Articles From osCommerce Templates
More Articles From osCommerce Templates
Print Article
Print
Share |
Comments, Questions & Reviews

Comments is currently disabled for this article!
Related Articles and Readings
Applying osCommerce Templates To Exisiting Shop
Ok, let's see how to install our OsCommerce Template on your existing shop without re-installing. Open your OsCommerce shop on ...
Updatig Images in osCommerce Templates
You should open your PSD file in Adobe Photoshop. Go to "sourcespsd" folder and there you will find all the ...
How to install an osCommerce template
Once you have downloaded a ZIP file, you should unpack the archive and save the unpacked files to any folder ...
Registering globals in osCommerce template
Q: I'm receiving the error that I need to enable register globals in my php.ini file. A: It's not a ...
What are osCommerce Templates?
osCommerce templates are ready made designs based on the open source ecommerce system. osCommerce is a well know e-commerce system ...
The information provided in this article is for general information and/or the comments is the sole responsibility of their respective authors and does not necessarily reflect the opinion of zeronese.net does not endorse any article and/or comments published by our web users unless otherwise noted.