Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] mv3.11 [item-list] [item-code] unexpected behavior in flypage



Ryan Hertz wrote:
> 
> Hello dying list...
> 
> I'm trying to generate a "mini-basket" in my product flypages, using code
> like this:
> 
> [item-list]
> "<small>[item-quantity] of [item-code] @ $[item-price]","[area [item-code]]",1,
> [perl arg=scratch interpolate=1]
>                 $Safe{'scratch'}->{'blah'} .= q{arMenu6_[calc][item-increment]+2[/calc] =
> new Array("[calc]$unqdesc = q([item-description]);$unqdesc =~
> s/(['"<>])/&quot; /g;return $unqdesc;[/calc] [if
> explicit][condition]$iscolor='[item-modifier color]';return 1 if $iscolor
> =~ /.../;return 0;[/condition]<BR> in [item-modifier color] [field
> code="[item-modifier color]" field="description"][/if]","[area
> [item-code]]",0);
>                 };
>                 return '';
> [/perl]
> [/item-list]
> 
> Aside from the freaky Javascripting going on, it is rather straight-forward
> list derived from basket.html.  The code works correctly in the basket
> page, but in a flypage [item-code] is interpolated as the current item (duh).
> 
> Strangely enough, [item-modifier color] returns the correct information!
> 
> How can I loop through the basket in a flypage?

I don't know the cause of this behavior, but I've an idea. Maybe my idea
can help you?

Make an usertag to access the cart like

######## set quantity of item to 1
#
#
#
UserTag minibasket Interpolate 1
UserTag minibasket Routine <<EOF
sub {
	package Vend::Interpolate;
        my $cart;
	$cart = $Vend::Items;
        my $code; 
	my $qty;
        my $itemtotal;
        my $out;
        foreach my $item (@$cart){
                $code = $item->{code}; 
      		$qty =  $item->{quantity};
                $itemtotal = $item->{price} * $item->{quantity};
and so on
                $out = "<small>";
                $out .= $code . " ";
and so on
        }
        return $out;
}
EOF

and use it in your flypage. Good lucks and happy new years!

Joachim

-- 
-------------Hans-Joachim Leidinger---------------------


_______________________________________________
Minivend-users mailing list
Minivend-users@minivend.com
http://lists.akopia.com/mailman/listinfo/minivend-users


Search for: Match: Format: Sort by: