Akopia Akopia Services

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

Re: [mv] Limit Quantity Solved and Tweaked



******    message to minivend-users from "Barney Treadway" <barney@wttech.com>     ******

Greetings group,

I just found and implemented this quantity lookup code provided by "Stan
Crump" <stanc@amintech.com> into basket.html but adapted it to allows for
instances where the sku is not in inventory table as we let inventory
management be optional. Thought someone else might enjoy it as well.

I love the way this presents the drop down of the quantity on hand.

[if data inventory::sku::[item-code]]
<select name=[quantity-name] value=[item-quantity]>
[perl interpolate=1]
$qvar = [item-quantity];
$ivar = [data inventory quantity [item-code]];
for ( $mvar = 1; $mvar <= $ivar; $mvar++ ) {
if ($mvar != $qvar) {
        $tmp .= "<option value=$mvar > $mvar\n";
        }
else {
        $tmp .= "<option value=$mvar SELECTED > $mvar\n";
        }
}
return $tmp;
[/perl]
</select>
    [else]
 <input type="text" name=[quantity-name] value="[item-quantity]" size=3>
    [/else]
    [/if]

Barney Treadway

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