Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-13-2010, 04:05 AM
  kevfromwiganinlancashire's Avatar 
kevfromwiganinlancashire kevfromwiganinlancashire is offline
 

X-Adept
  
Join Date: Nov 2004
Location: Appley Bridge
Posts: 563
 

Default 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
__________________
Php 5.4.16-36.el7_1
MySQL 5.5.41-2.el7_0
Apache
2.4.6-31.el7.centos



4.6.x stalled for now

5.2.6 developing
Reply With Quote
  #2  
Old 06-13-2010, 05:59 AM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default 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.
__________________
- Shane Munroe
Reply With Quote
  #3  
Old 06-13-2010, 06:39 AM
  kevfromwiganinlancashire's Avatar 
kevfromwiganinlancashire kevfromwiganinlancashire is offline
 

X-Adept
  
Join Date: Nov 2004
Location: Appley Bridge
Posts: 563
 

Default 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
__________________
Php 5.4.16-36.el7_1
MySQL 5.5.41-2.el7_0
Apache
2.4.6-31.el7.centos



4.6.x stalled for now

5.2.6 developing
Reply With Quote
  #4  
Old 06-13-2010, 06:51 AM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default 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}
__________________
- Shane Munroe
Reply With Quote
  #5  
Old 06-13-2010, 07:17 AM
  kevfromwiganinlancashire's Avatar 
kevfromwiganinlancashire kevfromwiganinlancashire is offline
 

X-Adept
  
Join Date: Nov 2004
Location: Appley Bridge
Posts: 563
 

Default 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.
__________________
Php 5.4.16-36.el7_1
MySQL 5.5.41-2.el7_0
Apache
2.4.6-31.el7.centos



4.6.x stalled for now

5.2.6 developing
Reply With Quote
  #6  
Old 06-13-2010, 07:47 AM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default 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}
__________________
- Shane Munroe
Reply With Quote

The following user thanks Shamun for this useful post:
kevfromwiganinlancashire (06-27-2010)
  #7  
Old 06-27-2010, 02:45 AM
  kevfromwiganinlancashire's Avatar 
kevfromwiganinlancashire kevfromwiganinlancashire is offline
 

X-Adept
  
Join Date: Nov 2004
Location: Appley Bridge
Posts: 563
 

Default 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
__________________
Php 5.4.16-36.el7_1
MySQL 5.5.41-2.el7_0
Apache
2.4.6-31.el7.centos



4.6.x stalled for now

5.2.6 developing
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:17 PM.

   

 
X-Cart forums © 2001-2020