[ic] packing units

Mike Heins interchange-users@interchange.redhat.com
Wed Jan 30 09:03:01 2002


Quoting G?tz Verdieck (goetz.verdieck@com4office.de):
> Hallo,
> 
> I have to add some changes for packing units.
> For example:
> A product is available as:
> Ring with 100m
> Drum with 500m
> 

[snip] 

> So how can I access the number the customer entered in the quantity
> input field. If the field input changes the update should be
> immediately. Do I have to use javascript or is there another way (for
> people who disabled javascript) ?
> 
> I hope somebody can give me a hint or a link.
> 

There are several ways. You can make a custom action, for instance:

ActionMap  order_units <<EOR
sub {
	my $units = $CGI->{units} || 1;
	$CGI->{mv_order_quantity} *= $units;

	# Set the page
	$CGI->{mv_nextpage} = 'ord/basket';

	# Update the basket
	$CGI->{mv_todo} = 'refresh';
	$Tag->update('process');

	## Returning true tells IC to display mv_nextpage
	return 1;
}
EOR

Now

    [page 
            href=order_units
            form="
                    mv_order_item=os28004
                    units=2
                    mv_order_quantity=100
            "
    ]Order it</A>

should do what you want.
		
If you want to handle multiple SKUs on the order link you would have
to split and parse each one.

Another way is to set an mv_click and update the mv_order_quantity there.

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown