Akopia Akopia Services

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

Re: [mv] some minivend math (here's one possible solution)



******    message to minivend-users from Mark Stosberg <mark@summersault.com>     ******

Mark Stosberg wrote:
> 
>    I'm setting up a bookstore for a publisher with Minivend and needs
> some discounts. I've reviewed the documentation on the issue but I'm
> confused which option(s) are right for me. My problem is
> straightforward: To start with, you get 30% off of everything, just for
> ordering directly. If you order 10 or more of any combinations of items,
> you get 55% of of everything.
>   These may sound like steep discounts, but they actually make _more_
> money selling directly this way then selling them through a distributor
> and then a bookstore!
>   Thanks for any pointers,
> 

Here's one possible solution I came up with for this. I put the
following code in my shopping basket:

    [calc] 
        [item-list]
            $totalq += [item-quantity];
        [/item-list]
            return '';
    [/calc]

[discount ALL_ITEMS] 
	if ($totalq >= 10) {
		return ($s * .45); 
	} else {
		return ($s * .70); 
	}	
[/discount]

[perl]
	if ($totalq >= 10) {
		return $Scratch->{percent_discount} = 55;
	} else {
		return $Scratch->{percent_discount} = 30;
	}	
[/perl]

These seems to do what I want, although it seemed like there should be a
way to combine my [discount] code with my [perl] code. I set
$Scratch->{percent_discount} just so I show people the size of the
discount they are needed. It's not strictly needed.

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