Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Global Help for Buy Now Links

Quote Reply
Global Help for Buy Now Links
Hey,

I'm using the table format and suggestiions from this thread:
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=247397

to add a table of retailers and retailer links to display on my detailed pages. I'm using the following global:

sub {
my $id = shift;
my $retailers = $DB->table('Retailers', 'RetailerLinks')->select( { link_id_fk => $id } )->fetchall_hashref;
my $output = qq~~;
foreach my $retailer (@$retailers) {
$output .= "<span class='buylink'><a href='$retailer->{rl_url}'>Buy Now</a></span><br />";
}
return $output;
}

and placing

<%buy_now($ID)%>

in the detailed page. This works fine as long as there is only one Retailer in the retailer table. If there are 2, it shows a link on the detailed page for both retailers even though the RetailerLinks table only has a match for one Link $ID.

Any suggestions? Does this need to run through a loop or something?
Subject Author Views Date
Thread Global Help for Buy Now Links pshadow 3963 Dec 14, 2005, 2:10 PM
Thread Re: [pshadow] Global Help for Buy Now Links
Andy 3926 Dec 15, 2005, 12:37 AM
Thread Re: [Andy] Global Help for Buy Now Links
pshadow 3897 Dec 15, 2005, 8:26 AM
Thread Re: [pshadow] Global Help for Buy Now Links
webmaster33 3913 Dec 15, 2005, 11:52 AM
Thread Re: [webmaster33] Global Help for Buy Now Links
pshadow 3887 Dec 15, 2005, 12:55 PM
Thread Re: [pshadow] Global Help for Buy Now Links
webmaster33 3880 Dec 15, 2005, 1:53 PM
Thread Re: [webmaster33] Global Help for Buy Now Links
pshadow 3861 Dec 15, 2005, 3:07 PM
Thread Re: [pshadow] Global Help for Buy Now Links
webmaster33 3855 Dec 15, 2005, 10:56 PM
Post Re: [webmaster33] Global Help for Buy Now Links
afinlr 3842 Dec 16, 2005, 3:18 AM
Post Re: [pshadow] Global Help for Buy Now Links
afinlr 3860 Dec 15, 2005, 3:09 PM