Akopia Akopia Services

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

Re: [mv] Problems with discounts



******    message to minivend-users from kphillips@ultratec.com     ******


I can not get this to work on my system. Here is the simpler version I am trying
to use:

[set discountAmount].75[/set]
[discount code=ALL_ITEMS] 
    my $p = $Scratch->{'discountAmount'};
    return ($s * $p);
[/discount]

I can not make the [discount] tag accept a variable of any kind. My goal is to
insert the variable from a Javascript function. The Javascript checks for a
typed-in coupon code and sets the discount rate based on which coupon is
enterred. Right now, I can't get any kind of variable to work within the
[discount][/discount] tag pair.

Running MiniVend 3.14-3 on Redhat Linux.

Any help would be appreciated. Thanks in advance.

   --Kerri
_______________________________________________________________________________
Subject: [mv] Problems with discounts
From:    minivend-users@minivend.com at Internet
Date:    6/1/45  09:29 PM

******    message to minivend-users from Chris Rapier <rapier@psc.edu>     *****
*


I'm trying to apply different discounts to different items using  the
following:

NB: I'm using a database of keys because it makes the searching much
faster. 
The key database looks like

sku sale
1 1 
2 .5 
3 4
6 3

where sku corresponds to the sku of the sale tiem in the products
database and the sale is the amount off in dollars

[loop search="fi=saleitems/st=db/ra=yes"]
 [loop search="fi=products/sf=sku/se=[loop-data saleitems sku]"]
      [seti item-discount][loop-data saleitems sale][/seti]
      [discount code="[loop-data saleitems sku]"] 
         my $p = $Scratch->{'item-discount'};
         return ($s - $p);
      [/discount]
      <img border = 0 src =
"http://__SERVER_NAME____IMAGE_DIR__/[loop-field image]"><BR>
      <b>[loop-field brand] [loop-field description]</b><br>
      <b>Save [currency][scratch item-discount][/currency] off the
regular price of [loop-price]!</b><br> 
      [currency][calc][loop-price noformat=1]-[scratch
item-discount][/calc][/currency][scratch tax-status] each<br>
      [order code="[loop-code]"]Buy Now[/order]<br>
 [/loop]
[/loop]

The problem is that all of the items end up have the same discount
amount applied to them corresponding to the discount of the last item
retrieved from the database (e.g. evrerythign on the sale list is
discounter $3). It doesn't seem to matter where I put the [discount]
code. I've a feeling this is because the inner loop is being run against
all the values of the outer loop in each iteration or that I don't
really understand how discount works.

If anyone can lend some help I'd appreciate it.
-
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
-
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: