X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How do I put an Affiliate Links/Images on category page (https://forum.x-cart.com/showthread.php?t=54151)

kevfromwiganinlancashire 06-13-2010 04:05 AM

How do I put an Affiliate Links/Images on category page
 
Hi, I have been trying to find a way to put affilate links on category pages i.e. if someone clicks on camping category the a link is displayed for a camping holiday company as well as the products or subcategories under camping, or if they click on motoring for oils etc then MoT station or tyre place would show. Is it possible to do something with the thumbnails so that they click on the thumb and it activates the link

Any advice gratefully accepted.

Thanks,

Kev

Shamun 06-13-2010 05:59 AM

Re: How do I put an Affiliate Links/Images on category page
 
I'm confused on what you're asking for with the second thing.

Quote:

Is it possible to do something with the thumbnails so that they click on the thumb and it activates the link

Could you possibly elaborate more? Are you just wanting a way to display some affiliate images but when clicked it sends them to the other site with your aff ID?



If so, this can easily be accomplished.

kevfromwiganinlancashire 06-13-2010 06:39 AM

Re: How do I put an Affiliate Links/Images on category page
 
Hello Tal,

Yes that's what I am trying to do. I did try putting the code into the welcome page to test but just saw the code under everything else.

Also can't decide wether to allow them to follow the link or open new browser but that's for later I suppose

Kev

Shamun 06-13-2010 06:51 AM

Re: How do I put an Affiliate Links/Images on category page
 
If your site is small, you can do something like this:

{if $cat eq '1'}
Affiliate stuff for category ID 1

{elseif $cat eq '2'}
Affiliate stuff for category ID 2

{elseif ( $cat eq '3' || $cat eq '4' ) }
Affiliate stuff that will show if in either cat #3 or 4.

{elseif $cat gte '5'}
Affiliate stuff that will show if in cat 5 or higher

{elseif $cat gt '5'}
Affiliate stuff that will show if in cat 6 or higher.
{/if}

kevfromwiganinlancashire 06-13-2010 07:17 AM

Re: How do I put an Affiliate Links/Images on category page
 
Quote:

Originally Posted by Tal
If your site is small, you can do something like this:

{if $cat eq '1'}
Affiliate stuff for category ID 1

{elseif $cat eq '2'}
Affiliate stuff for category ID 2

{elseif ( $cat eq '3' || $cat eq '4' ) }
Affiliate stuff that will show if in either cat #3 or 4.

{elseif $cat gte '5'}
Affiliate stuff that will show if in cat 5 or higher

{elseif $cat gt '5'}
Affiliate stuff that will show if in cat 6 or higher.
{/if}



so in
{elseif $cat eq '2'}
Affiliate stuff for category ID 2

I would put {elseif $cat eq'250'} or do I use =250
then here would put the affiliate code?

I have 15 categories with subs
how do I put multiple affiliates within one category?


Thanks Tal, I will have a play and see what happens.

Shamun 06-13-2010 07:47 AM

Re: How do I put an Affiliate Links/Images on category page
 
You need an {if} statement first, then an {elseif} or {else} statement and close all of them with a {/if}

So, the bare minimum would look like this:
Code:

{if cat eq '1'}
Stuff

{elseif $cat eq '2'}
Stuff

{/if}



Use eq for equels, neq for not equals, gte for greater than or equal, gt for greater than, lt for less than, lte for less than or equal.


As for multiple within one category, just put them inside the statement for that such as this:

Code:

{if $cat eq '1'}
<a href="www.link1.com"><img src="www.foobar.com/gif.gif"></img></a>
<a href="www.link2.com"><img src="www.foobar.com/gif.gif"></img></a>

{elseif $cat eq '2'}
<a href="www.link3.com"><img src="www.foobar.com/gif.gif"></img></a>
<a href="www.link4.com"><img src="www.foobar.com/gif.gif"></img></a>

{/if}


kevfromwiganinlancashire 06-27-2010 02:45 AM

Re: How do I put an Affiliate Links/Images on category page
 
Apologies Tal for not thanking you for your last post.
I've had to put it on back burner for now though


All times are GMT -8. The time now is 02:55 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.