[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Slick little inventory checker (not!)
****** message to minivend-users from Handytman@aol.com ******
No problem, Barney.
On my results page and flypage, the code I posted sets the condition "are
there any?".
So, the code on the results page would be something like:
[snip]
[if explicit]
[condition]
return 1 if (('[item-field limited]' eq 'yes') && ('[item-data
inventory qty]' < 1));
return 0;
[/condition]
Item not available - We ran out!
[else]
We have it!
[/else]
[/if]
[/snip]
You can print the quantity available; [item-data inventory qty]
As far as verifying that the customer doesn't order more than we have, I do
that on the shopping cart page. I use perl to run through the cart and check
quantities against the inventory database. Where an excess is ordered, I
reduce the quantity to the maximum available. If there's a better way, I'm
all ears!
Hope this helps,
Rob Maurer
In a message dated 1/10/00 12:12:59 PM Eastern Standard Time,
barney@wttech.com writes:
> Thanks for the reply Rob,
>
> This wouldn't handle instances of item quantity being 5 and and inventory
> being 4 though would it? Or would I combine the two expressions???
>
> Thanks in advance and pardon my ignorance.
>
> Barney
>
> > [perl interpolate=1]
> > return 1 if (('[item-field limited]' eq 'yes') && ('[item-data
> >inventory qty]' < 1));
> > return 0;
> > [/perl]
> >
> >This checks products.asc for a 'yes' in my 'limited' field (indicating
that
> >this product has an entry in inventory.asc) and then checks if the
quantity
> <
> >1.
>
> >> Can a savvy mvender show me how to do some magic and determine if
> there's
> >> value on the inventory qty before comparing to item-quantity in
> basket.html?
> >>
> >>
> >> [if data inventory::qty::[item-code] < [item-quantity] ]
> >> NOT AVAILABLE
> >> [else]
> >> <input type="text" name=[quantity-name] value="[item-quantity]" size=3>
> >> [/else][/if]
>
-
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