Akopia Akopia Services

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

[mv] MV 3.14-5 - Number of line item on order



******    message to minivend-users from Barry Treahy <treahy@mmaz.com>     ******

In the MV documentation I found two different examples for determining
the number of line items in a basket, not the number of items ordered.


My modified version of either example still do not work.

[perl arg=scratch]
    $items = q{[item-list][item-code]|[/item-list]};
    @items = split /\|/, $items;
    $count = 0;
    for (@items) {
    $count++ unless $seen{$_}++;
    }
    $Safe{'scratch'}{'line_items'} = $count;
    return '';
[/perl]
returns a 2 when there are no items in the basket when referenced with
[scratch line_items] and and at the same time of returning 2, this if
[if scratch line_items gt 19] thinks that line_items is > 19.

This second example that I tried to make work from the docs always
returns zero, but at least the [if] worked..
[perl arg=scratch]
    $Safe{'scratch'}{'line_items'} = $#{$Safe{'carts'}->{'main'}} + 1;
    return '';
[/perl]

Any skilled suggestions?

Regards,

Barry Treahy

-
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: