[ic] Restricting orders

cfm@maine.com cfm@maine.com
Fri, 9 Feb 2001 14:15:23 -0500


On Fri, Feb 09, 2001 at 08:12:08AM -0800, Ed LaFrance wrote:
> At 09:44 AM 02/09/2001 +0800, you wrote:
> >Hi!
> >Question:
> >How do I restrict a customer so that he/she can only order a maximum
> >quantity of 1 for each item?
> >
> >Bryan
> 
> I don't think there is any way to do this other than editing the catalog pages:
> 
> 1.  Simply use [order [item-code]]Order this item[/order] as your order 
> link (it places 1 item in the cart by default), or use a hidden input:
> 
> <input type=hidden name=mv_order_quantity value=1>
> 
> ...for form-based ordering.

They's still be able to order more by returning to flypage, no?

You need something that iterates the basket items and blows away more than
one of the items in question.  Something along lines:


   {
        my($item);
        for $item (@{$Vend::Session->{carts}{main}}) {
            next unless ($item->{code} eq "the one you want to limit");
            $item->{quantity}=1 if ($item->{quantity}>0);
        }
    }
    &Vend::Session::put_session();  # might not need this YMMV


make it a usertag and make sure visitor can't get by it.

> 
> 2. Edit the basket and checkout pages to make the text input box for the 
> item qty a hidden input (similar to above).  Place [item-quantity] by 
> itself in the same <td> as the hidden input if you want to display the "1" 
> in the qty column.
> 
> That should do it!
> 
> - Ed L.
> 
> 
> 
> 
>  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> New Media E.M.S.               Software Solutions for Business
> 463 Main St., Suite D          edl@newmediaems.com
> Placerville, CA  95667         http://www.newmediaems.com
> (530) 622-9421                 (530) 622-9426 Fax
> (866) 519-4680 Toll-Free
>  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> 
> 
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users

-- 

Christopher F. Miller, Publisher                             cfm@maine.com
MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
1.207.657.5078                                       http://www.maine.com/
Content management, electronic commerce, internet integration, Debian linux