[wellwell-devel] [wellwell] Use links for discounted items in [coupons display].
Stefan Hornburg
wellwell-devel at rt.icdevgroup.org
Thu Sep 9 14:12:15 UTC 2010
commit 4d811df87db9af0bb79649d932815c5dafb89298
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Sat Sep 4 11:44:47 2010 +0200
Use links for discounted items in [coupons display].
lib/WellWell/Coupon.pm | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/lib/WellWell/Coupon.pm b/lib/WellWell/Coupon.pm
index 764ad60..509911d 100644
--- a/lib/WellWell/Coupon.pm
+++ b/lib/WellWell/Coupon.pm
@@ -104,7 +104,7 @@ sub coupons {
}
if ($function eq 'display') {
- my (@out);
+ my (@out, @links);
if (exists $Vend::Session->{coupons}) {
$repo = $Vend::Session->{coupons};
@@ -120,7 +120,14 @@ sub coupons {
$hash{target} = ' all items';
}
elsif ($hash{subject} eq 'product') {
- $hash{target} = join(', ', @{$hash{targets}});
+ my (@links, $url);
+
+ for (@{$hash{targets}}) {
+ $url = Vend::Tags->area($_);
+ push(@links, qq{<a href="$url">$_</a>});
+ }
+
+ $hash{target} = join(', ', @links);
}
push (@out, Vend::Tags->uc_attr_list({hash => \%hash, body => $body}));
More information about the wellwell-devel
mailing list