Akopia Akopia Services

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

Re: [mv] How to allow only one product category / basket?



******    message to minivend-users from cfm@maine.com     ******

On Thu, Jun 22, 2000 at 12:18:02AM -0400, Ramsey French wrote:
> ******    message to minivend-users from Ramsey French <rammjet@mac.com>     ******
> 
> One thought is everytime the customer selects a product, set a scratch
> variable that corresponds to that category to some value like 1 or 0.  When
> he selects another product, test the scratch variable for that category to
> see if it has already been set from the previous action.  If it has been set
> (meaning he already selected one from that category) then take appropriate
> action like automatically change it or warn him that he has two from the
> same category and ask him what he wants to do.


This snippet lets visitor select only one item (but any qty) from
a certain range of item codes.  You could just as well use an attribute
or category as long as it is there in the cart.  It goes in the item's
flypage.  In this particular case the items 100\d\d\d have their own
flypage; you might have to have a different flypage per category or write
something more complex.

   {
        #this blows away any lobsters so reload will work
        my ($i,@master,$s); # from Data.pm toss_cart()
        $s=$Vend::Session->{carts}{main};
      DELETE: for (;;) {
          foreach $i (0 .. $#$s) {
              if ($s->[$i]->{'code'} =~ /^100\d\d\d$/ && !$s->[$i]->{mv_mi}) {
                  push (@master, $s->[$i]->{mv_mi}) if $s->[$i]->{mv_mi} && ! $s->[$i]->{mv_si};
                  splice(@$s, $i, 1);
                  next DELETE;
              }
          }
          last DELETE;
      }
        &Vend::Session::put_session();
    }


> 
> > ******    message to minivend-users from "Rene Hertell" <rene@hertell.com>
> > ******
> > 
> > Hello again...
> > 
> > Can someone give me a tip how to work this out:
> > 
> > I have to allow my customers to add only one product per category to his
> > basket. If he changes the product, if should be replaced by a new value.
> > 
> > Is there any function for this, or do I have to make some other programming?
> > 
> > regards, René
> 
> -
> 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

-- 

Christopher F. Miller, Publisher                             cfm@maine.com
MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
1.207.657.5078                                       http://www.maine.com/
Database publishing, e-commerce, office/internet integration, Debian linux.
-
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: