Akopia Akopia Services

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

[mv] Using CommonAdjust for MixMatch (I'll beg if I have to!)



******    message to minivend-users from "March Roseland" <march@uia.net>     ******

Hi, all,

Yes, it's me again.  Usually, I'd be much more patient with this, but I'm
being pressured to send an email to Mike _directly_ and bug him about it,
which I would really, really rather not do, and I can't seem to properly
explain that this is a free program and he doesn't owe us anything no matter
HOW far past the deadline we are...

So please, anyone with any ideas at all, just toss them out, I beg you!
Privately or to the list, either way!

Here's all the relevant information, as clearly as I can figure out to
explain it:

Minivend 4.04 (catalog being upgraded from 3.14, seems fine now except this
problem)
Perl 5.005 (built for i386-netbsd)
NetBSD 1.4.2
Apache 1.3.9

We were using the MixMatch directive so that price breaks were cumulative by
total number of items, regardless of sku; i.e., 3 of item A and 23 of Item B
would take you into the 26 to 100 item level, and lower both prices
accordingly.

Since it was removed, I'm trying to use CommonAdjust, which is supposed to
replace it.  I was having very little luck, but found the mix-match usertag
in the archives:

    UserTag mix-match Order number
    UserTag mix-match Routine <<EOR
    sub {
        my $nitems = shift;
        my $ca_string = 'products:price';
        my $level;
        my @breaks = ( 26, 100, 200 );
        foreach $level ( @breaks ) {
                last if $nitems < $level;
                $ca_string = "pricing:q$level";
        }
        return $ca_string;
    }
    EOR


    CommonAdjust   "[mix-match number='[nitems]']",
;pricing:price_group,q1,q26,q100,q200, ;products:price


This works wonderfully, with one problem -- quantity.html, which ought to
have four columns (1-25, 26-99, 100-199, and 200-499) each with the price of
each item for that quantity (3.00, 2.00, 1.60, 1.20), instead gives only the
price for 1-25, i.e., 3.00 in all four columns.  However, if you click on
one of these to order that amount, the correct price shows up in the cart,
such as 2.00 if you ordered 26.  Further, if you order 5 of Item A and 21 of
Item B, both register at the 26 item price.  So the only thing wrong there
is what [loop-price <quantity>] displays in quantity.html; a cosmetic
problem, but still a problem.

To fix this, I tried doing it what seems to be the 'right' way: by creating
a column 'price_group' in the pricing database, and populating it, in each
row, with '1'.  As I understand the documentation, that should put all the
items in the same price group.  Then, I set the following CommonAdjust
directive:

CommonAdjust   pricing:price_group,q1,q26,q100,q200:, ;products:price

in my catalog.cfg.  I have tried several other variations as well, with no
luck.  What happens with this is that while quantity.html now displays the
correct prices in each of the four columns, the MixMatch functionality does
not occur.  That is to say, if you order 5 of Item A and 21 of Item B, each
is priced at the 1-25 price rather than the 26-99 price.  If you order 26 of
Item B and 5 of Item A, only Item B is given the lower price.

I am fairly sure that I must be doing something wrong here, and that this
isn't any failing of minivend itself -- but what?  I've tried everything I
can think of and read the CommonAdjust documentation over and over, to no
avail.  Someone out there must have this working properly!

Due to the time crunch, anyone who requires begging, please send your
solution and let me know, and I'll send you a nice page or so of retroactive
pleading along with my sincere gratitude. ;)

Thanks...

-- March

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