[ic] MaxQuantityField, cart.pm modification; to allow for stock at multiple locations

John1 list_subscriber at yahoo.co.uk
Sun Apr 18 16:44:35 EDT 2004

I would like to submit a feature suggestion:

It would be good if the MaxQuantityField code in cart.pm could cope with
more than 1 quantity field in the inventory table.

e.g.  In a scenario where there are 3 warehouses:

MaxQuantityFiled inventory::quantity1::quantity2::quantity3

where quantity1, quantity2 and quantity3 are 3 separate fields in table
"inventory", recording stock levels at the 3 warehouse.

Personally I need to maintain stock levels at 2 separate locations so have
made a bespoke modification to cart.pm to cope with this scenario.  However,
I only have a very basic knowledge of Perl so would struggle to put together
the code to allow the MaxQuantityField configuration directive to cope with
an arbitrary number of columns/warehouses.  So, if others also think this
would be a useful feature, please could I submit this as a feature request
:-)  Thanks

For illustration, starting at line 223 of cart.pm, my code modification to
cope with 2 columns is:

if($Vend::Cfg->{MaxQuantityField}) {
    my ($tab, $col1, $col2) = split /:+/, $Vend::Cfg->{MaxQuantityField};
    if(! length $col1) {
     $col1 = $tab;
     $tab = $item->{mv_ib} || $Vend::Cfg->{ProductFiles}[0];
    $item->{mv_max_quantity} = ::tag_data($tab, $col1, $item->{code}) +
::tag_data($tab, $col2, $item->{code});

More information about the interchange-users mailing list