Zen Cart Logo
Forums / Basic Configuration / sidebox catagory link

sidebox catagory link

Locked

Views: 1,936

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
9 Aug 2006, 10:21 PM
#1
crazyjims_co_uk avatar

crazyjims_co_uk

New Zenner

Join Date:
Aug 2006
Posts:
4
Plugin Contributions:
0

sidebox catagory link

hello,

i was wondering if their is a way to change the link in the catagory side box to go to a new web page?

i.e

mobile phones (click this and it would go to a new web page instead of going to catagory selection)

i hope i have made sense!!

cheers

james

9 Aug 2006, 11:38 PM
#2
kuroi avatar

kuroi

Totally Zenned

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

Re: sidebox catagory link

The category side box exists for no reason other than to give visitors links to the sites categories. However you also have an EZ-Pages sidebox that does does support links to pages external to the Zen Cart.

10 Aug 2006, 12:20 AM
#3
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: sidebox catagory link

You could also hack the bottom part of the the category box. The part that has "all products" & "new products" and put your links here. :lookaroun

However I'm with Kuroi on this, go for ez-pages. Its so much easier.

3 Sep 2006, 9:29 AM
#4
crazyjims_co_uk avatar

crazyjims_co_uk

New Zenner

Join Date:
Aug 2006
Posts:
4
Plugin Contributions:
0

Re: sidebox catagory link

cheers for the response,

i added the link into the more info box but i dont feel that this is very affective, how do i change the "all products" link to link to a different site?

i have got 2 websites.
i would like to link my "contract mobile phones" to the new website. it would be great if i could put this link in the catagory box

cheers
james

3 Sep 2006, 9:46 AM
#5
kuroi avatar

kuroi

Totally Zenned

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

Re: sidebox catagory link

To pop the link into the bottom of the categories list, make a copy of the sidebox/tpl_categories.php file in your template sideboxes directory.

Then edit the new file to insert a new line before line 93 ($content .= '<div'>;) that says> $content .= '<a class="category-external" href="http://yourexternalURL">Your external URL description</a>' . "\n";and then create a style for .category-external or add it to the definition you already have for .category-links if you want it to match the others at the bottom of the categories box.

9 Sep 2008, 10:48 PM
#6
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: sidebox catagory link

now how would you hide a link so only logged in users could veiw

if (!$_SESSION['customer_id']) {
$content .= '<a class="category-internal" href="http://www.gorillagear.ca/index.php?main_page=index&cPath=38">Clearance Bin</a>' . "\n"; 

this doesn't seem to work any ideas

10 Sep 2008, 12:46 AM
#7
kuroi avatar

kuroi

Totally Zenned

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

Re: sidebox catagory link

@MB1

A couple of things leap to mind.

Firstly you're using a internal link that would be shown normally by the categories sidebox, so have you inhibited that for all customers? If so, how?

Secondly the code that you have posted is both back to front and incomplete. The "!" in front of the $_SESSION varable means only do what follows when the customer is not logged in, which seems to me the opposite of what you are trying to achieve. And the IF statement has an opening bracket but no closing bracket.

10 Sep 2008, 5:38 AM
#8
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: sidebox catagory link

i was just playing with the hide side box code and seeing if i could apply it to a link in a side box but i really don't know what i'm doing i must of played with the code a few differant was with no results

10 Sep 2008, 3:31 PM
#9
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: sidebox catagory link

ok i got it
in store/includes/functions/extra_functions/group_check.php which was created for me by swguy i added this piece of code which i'm sure could be cleaned up but it works

// for members: Deny not logged in.
    function verify_customer_group_members() {
       global $db;
       if ( !isset($_SESSION['customer_id']) || ($_SESSION['customer_id'] == '')) {
           return false;
       }
       return true;  // include all others
    }

then in store/includes/templates/zzz/sideboxes/tpl_categories.php i added the folowing just above $content .= '</div>';

if (verify_customer_group_members()) { 
$content .= '<a class="category-internal" href="http://www.gorillagear.ca/index.php?main_page=index&cPath=38">Clearance Bin</a>' . "\n"; 
 }

works fine now