<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<BR>&nbsp;&gt; From: peter@pajamian.dhs.org<BR>&gt; On 22/11/10 19:49, Rick Bragg wrote:<BR>&gt; &gt; On Wed, 2010-11-17 at 09:16 -0800, Marty Tennison wrote:<BR>&gt; &gt;&gt; Starting a new thread for discount specs....<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; I just got done implementing this in our system so it's fresh in my mind. If <BR>&gt; &gt;&gt; this is something anyone is interested in I'll be happy to elaborate and/or <BR>&gt; &gt;&gt; collaborate on the spec and share my experiences. <BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; ================================================================<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Discounts have 3 major parts. <BR>&gt; &gt;&gt; 1) Discounts<BR>&gt; &gt;&gt; 2) Rules<BR>&gt; &gt;&gt; 3) Actions<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; DISCOUNTS:<BR>&gt; &gt;&gt; Discounts have one or more rules.<BR>&gt; &gt;&gt; Discounts have one or more actions.<BR>&gt; &gt;&gt; Discounts can be active or inactive<BR>&gt; <BR>&gt; Great idea<BR>&gt; <BR>&gt; &gt;&gt; DISCOUNT_ACTIONS:<BR>&gt; &gt;&gt; Actions have a type, operator and value<BR>&gt; &gt;&gt; Action types are actually modules (subs) that can be plugged in as new actions <BR>&gt; &gt;&gt; are needed<BR>&gt; &gt;&gt; Action types: (ideas)<BR>&gt; &gt;&gt; 1) Percentage of subtotal<BR>&gt; &gt;&gt; 2) Fixed amount<BR>&gt; &gt;&gt; 3) Free Shipping<BR>&gt; &gt;&gt; 4) Discount sku by fixed amount<BR>&gt; &gt;&gt; 5) Discount sku by percentage<BR>&gt; &gt;&gt; 6) Discount sku by (amt * qty)<BR>&gt; &gt;&gt; 7) Display message<BR>&gt; &gt;&gt; 8) Log something<BR>&gt; &gt;&gt; 9) Deactivate discount (make discount a single use coupon)<BR>&gt; &gt;&gt; Action Operator:<BR>&gt; &gt;&gt; 1) (only used to enter SKU if needed for item 4,5,6 above)<BR>&gt; &gt;&gt; Action Values:<BR>&gt; &gt;&gt; &lt;user defined input&gt; ie: .65, 5 etc...<BR>&gt; <BR>&gt; percentage and fixed amounts can be combined into a single action. I<BR>&gt; usually just use the % character at the end of the amount to<BR>&gt; differentiate, and I do something like this to normalize it:<BR>&gt; <BR>&gt; if ($amount =~ s/%$//) {<BR>&gt; $amount = $price * $amount / 100;<BR>&gt; }<BR>&gt; <BR>&gt; Of course there are also ways to make this infinitely more complex, with<BR>&gt; sales such as, "buy two t-shirts (could be any of 50 distinct t-shirt<BR>&gt; skus) and get a free cap", or even, "get this perfume set for only $10<BR>&gt; with your order of $100 or more" (what do you do if the perfume set is<BR>&gt; not in the cart, do you add it automatically, prompt the customer, or<BR>&gt; discard the discount?), etc.<BR><BR>
Automatically put something that is not free in their cart? ZOINKS! Naaaa, I know what you saying :-)<BR>
&nbsp;<BR>
Our system has these kind of deals, and invariably the best thing to do is keep the customer informed. Like I mentioned, we have this perpetual deal so the cart is always egging the customer to buy more... just a little bit more and you can get this too! or, now you qualify for...<BR>
&nbsp;<BR>
I've been meaning to reply to Marty's thread when I get more time. I should have time on Friday to add something meaningful to this.<BR>
&nbsp;<BR>
Paul<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>                                               </body>
</html>