[if ordered [item-code]]
This item is currently in your [page ord/basket]shopping cart.
[/if]
[item-field comment]
[if-item-data merchandising others_bought]
[perl tables=products]
my $hash = [item-data merchandising others_bought];
my @ary = sort { $hash->{$b} <=> $hash->{$a} } keys %$hash;
return '' unless @ary;
my %in_basket;
splice(@ary, 3);
for(@{$Carts->{main}}) {
$in_basket{$_->{code}} = 1;
}
@ary = grep ! $in_basket{$_}, @ary;
return '' unless @ary;
my $out = <<'EOF';
Customers who bought this item also bought: |
EOF
for(@ary) {
my $desc = tag_data( 'products', 'description', $_);
$out .= <$desc
EOF
}
return $out . ' | ';
[/perl]
[/if-item-data]
|