Akopia Akopia Services

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

[mv] MV 3.14-5 - Automatically adding SKU to order



******    message to minivend-users from "Barry Treahy, Jr." <Treahy@mmaz.com>     ******

I haven't received any suggestions on how to make MV add a required SKU
to an order where one-click cannot work because the SKU being ordered is
entered and not a on-screen selection.

What I have attempted is to accept the input, move to another page to
run a little Perl for a quick check, and return.  Basically, it doesn't
work and even will full debugging in MV turned on, I'm not getting
enough diagnostic information to know why and there are no errors being
reported.

Any help or recommendations would be appreciated.  Here is the snippet
of the check_special.html page.  The basic logic is to loop through the
cart creating a temporary cart without any SUL- prefixed SKU's, and then
loop through the temporary create to create the final cart adding in any
auto_addon SKU's:

<!-- item-list looping to create temp-cart cart -->
<!--
[set temp-cart][/set]
[item-list]
  [if value item-code ne m/SUL-*/]
    [perl arg=carts interpolate=1]
        my $tempItems = '[nitems temp-cart]';
        my $code = '[item-code]';
        $Safe{'carts'}->{'temp-cart'}->[$tempItems]->{'code'} =
'[item-code]';
        $Safe{'carts'}->{'temp-cart'}->[$tempItems]->{'quantity'} =
'[item-quantity]';
    [/perl]
  [/if]
[/item-list]
-->
<!-- item-list of temp-cart cart to update main cart -->
<!--
[set new-cart][/set]
[item-list temp-cart]
  [perl arg=carts interpolate=1]
    my $main = $Safe{'carts'}->{'temp-cart'};
    my @newMain=();
    my $itemMain;

    foreach $itemMain (@$main) {
        @newMain = (@newMain, $itemMain);
        if (/[data table=products field=code key=[item-code]
column=auto_addon]/ eq m/SUL-*/) {
          my $mainItems = '[nitems main]';
          $Safe{'carts'}->{'new-cart'}->[$mainItems]->{'code'} = '[data
table=products field=code key=[item-code] column=auto_addon]';
          $Safe{'carts'}->{'main'}->[$mainItems]->{'quantity'} = 1;
          @newMain = (@newMain, $itemMain);
        }
    }
    @{$main} = @newMain;
    return;
  [/perl]
[/item-list]
-->


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