Akopia Akopia Services

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

[mv] UserTag Error MV4.04/Mysql



******    message to minivend-users from "Humberto T Reyes" <htreyes@evine.com>     ******

Greetings,

I am new to UserTags and I am tring to implement a version of one that I
found on the mailing list here it is:


-----snip-----
UserTag qty-min Routine <<EOR
sub {
        my $cart = $Vend::Items;
        my $item;
        my $message = ' ';
        my $itable = "minimum";
        my $qty_field = "min_order";
        foreach $item (@$cart) {
                $want = $item->{'quantity'};
                $minimum = Vend::Interpolate::tag_data($itable, $qty_field,
$item->{sku})|| '0';
                if ($want < $minimum) {
                        $item->{'quantity'} = $minimum;
                        $message .= "The minimum order for item $item->{sku}
is $minimum<br>";
                }
        }
        $message .= "Ordered quantities have been adjusted." if $message;
        $Vend::Session->{qty-alert} = $message;
    return '';
}
EOR

---Snip-----

However,  when I restart MV I get the following error--COULD SOMEONE PLEASE
HELP--why am I getting this error.

----Error----
UserTag 'qty_min' subroutine failed compilation:

        Global symbol "$want" requires explicit package name at (eval 113)
line 8, <CONFIG> chunk 337.
Global symbol "$minimum" requires explicit package name at (eval 113) line
9, <CONFIG> chunk 337.
Bareword "qty" not allowed while "strict subs" in use at (eval 113) line 16,
<CONFIG> chunk 337.

In line 337 of the configuration file 'catalog.cfg':
UserTag qty-min Routine <<EOR
---Error---


Thank you to all in advance,

Humberto Reyes
htreyes@earthlink.net

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: