Zen Cart Logo
Forums / Basic Configuration / adding link to categories sidebox under all products

adding link to categories sidebox under all products

Locked

Views: 1,849

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
9 Sep 2007, 4:34 AM
#1
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

adding link to categories sidebox under all products

I've searched all through the tutorials and forum and haven't been able to find the answer to my question. What do I need to do to add a link to my site's Quick Orders mod page on the category sidebox? I would like to place it under the "All Products" link. I've had a look at MYTEMPLATE/templates/tpl_categories.php and have located the code for the "permanent" category links of specials, featured products, new products and all products. But I don't know what steps I need to take to add "Quick Orders" to them. Can anyone please give me a step by step of what to do? I'm still pretty wet behind the ears with coding, and for the thousands of other newbies like me I would gladly package it together for the tutorials/wiki or as a mod.

Thanks!

Matt

9 Sep 2007, 9:43 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: adding link to categories sidebox under all products

You're in the right file. Just two steps:

  1. Add the following to the file that you are using to override english.php (or whatever language file you are using on your site) and add the following to it```php
    define('CATEGORIES_BOX_HEADING_QUICK_ORDER', 'Quick Order by Model');

2. Replace this
```php
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }
  }
  $content .= '</div>';

with this

    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }
    $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_QUICK_ORDER) . '">' . CATEGORIES_BOX_HEADING_QUICK_ORDER . '</a>' . "\n";
  }
  $content .= '</div>';
9 Sep 2007, 4:36 PM
#3
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: adding link to categories sidebox under all products

Thank you so much Kuroi!!! That did it!:clap:

Just to clarify my original post, the category file that needs to be changed is in includes/templates/MYTEMPLATE/sideboxes/tpl_categories.php and the define file needs to be added to includes/languages/MYTEMPLATE/english.php (or whatever language you are using).

I had to change your code slightly to fit the code of the CSS flyout menu that I'm using, so for anyone else using this menu the code changes are:

look for this code:

if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') { 
      $content .= '<ul class="level1"><li><a href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a></li></ul>'; 
    } 
  } 
  $content .= '</div>';  

and change it to this:

 if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') { 
      $content .= '<ul class="level1"><li><a href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a></li></ul>'; 
    } 
 $content .= '<ul class="level1"><li> <a href="' . zen_href_link(FILENAME_QUICK_ORDER) . '">' . CATEGORIES_BOX_HEADING_QUICK_ORDER . '</a></li></ul>'; 
  } 
  $content .= '</div>';   

You can, of course, substitute any other page link to suit your needs.

Thanks again!

Matt

27 Sep 2007, 1:56 PM
#4
adventurestore avatar

adventurestore

New Zenner

Join Date:
May 2007
Posts:
6
Plugin Contributions:
0

Re: adding link to categories sidebox under all products

Hi,
I am interested in doing a similar thing - please excuse me if this is a stuipid question but i would like to a link in the cat box to go to a new page e.g. page2 which will host an iframe link to a whitelabel affiliate site. Can I do this in the same way?

27 Sep 2007, 2:00 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: adding link to categories sidebox under all products

The two variants of code above (select according to the type of categories box template you are using) will work for any internal link with small tweaks to direct them to the specific page you require. What you're going to do on that page will have no bearing on the method used to link to it.

27 Sep 2007, 2:37 PM
#6
adventurestore avatar

adventurestore

New Zenner

Join Date:
May 2007
Posts:
6
Plugin Contributions:
0

Re: adding link to categories sidebox under all products

Thanks for the quick reply - Almost got it working :smile: