[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Lost mv_modifier values
>
>> The problem appears when I select the delete checkbox in the cart.
>> After the refresh the selected item is deleted (that¹s what I wanted) and
>> the vpe modifier info for the rest of the entries is also deleted.
>
> sounds like you don't have your additional modifier included in the form..
> do you have an [item-accessories vpe] or whatever? Usually the modifier is a
> combo box and is therefore resubmitted when the form is updated (due to
> deleting a line / changing a modifier etc).
>
> Jonathan
> Webmaint.
>
>
>
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users
>
Hi,
I store the values from the form and the form actions runs the following
action map
(in this action map I store values for $CGI->{mv_order_quantity} and
$CGI->{mv_order_vpe}:
ActionMap order_units <<EOR
sub {
# save and delete \0 from units: Mengeneinheiten; quantity: Anzahl der
Einheiten; bezeichnung: Bezeichnung und der Artikelnummer
$Scratch->{'bezeichnung'} = $CGI->{'bezeichnung'};
$myfield = $Scratch->{'bezeichnung'};
@bezeichnung = split("\0",$myfield);
$Scratch->{'quantity'} = $CGI->{'quantity'};
$myfield = $Scratch->{'quantity'};
@quantity = split("\0",$myfield);
$Scratch->{'units'} = $CGI->{'units'};
$myfield = $Scratch->{'units'};
@units = split("\0",$myfield);
$Scratch->{sku} = $CGI->{mv_order_item};
# SKU already in cart => set to 0
my $cart = $Carts->{main};
my $count = 0;
foreach (@$cart){
if ($Scratch->{sku} eq $cart->[$count]{code}){
$Carts->{main}[$count]{quantity}= "0";
}
$count++;
}
# calculate the quantities:
$CGI->{mv_order_quantity} = 0;
$Scratch->{mv_order_quantity} = 0;
$CGI->{mv_order_vpe}="";
for ( my $i = 0; $i < @units; $i++) {
if ( $quantity[$i] > 0) {
$Scratch->{mv_order_quantity}+= $units[$i]*$quantity[$i];
$CGI->{mv_order_quantity} += $units[$i]*$quantity[$i];
$CGI->{mv_order_vpe} =
$CGI->{mv_order_vpe}."/".$quantity[$i]."/".$units[$i]."/".$bezeichnung[$i];
}
}
# Set the page
$CGI->{mv_nextpage} = 'inbasket';
# Update the basket
$CGI->{mv_todo} = 'refresh';
$Tag->update('process');
## Returning true tells IC to display mv_nextpage
return 1;
}
EOR
I the cart I can display the correct modifier values but when deleting on
item all the modifiers are gone.
Yours sincerely,
Goetz Verdieck
E-Mail Goetz.Verdieck@com4office.de