[ic] Discount Question

Stefan Hornburg (Racke) racke at linuxia.de
Wed Jul 21 08:49:41 UTC 2010


On 07/11/2008 05:16 PM, Stefan Hornburg (Racke) wrote:
> Ton Verhagen wrote:
>> Quoting Stefan Hornburg:
>> At 04:36 PM 7/3/2008, you wrote:
>>> Hello,
>>>
>>> I'm working on a pretty simple discounting scheme for a client: 10% off
>>> for every order with a subtotal>= 100$. This should be very easy to
>>> implement.
>>>
>>> Let's try that:
>>>
>>> [tmp total][subtotal noformat=1][/tmp]
>>> [if type=explicit compare=`$Scratch->{total}>= 100`]
>>> [discount ALL_ITEMS]
>>> $s * 0.9
>>> [/discount]
>>> [else]
>>> [discount ALL_ITEMS][/discount]
>>> [/else]
>>> [/if]
>>>
>>> OK, but here are the problems:
>>>
>>> [subtotal] has existing discounts already applied if I understand the
>>> source code correctly, so change the above to:
>>>
>>> [discount ALL_ITEMS][/discount]
>>> [tmp total][subtotal noformat=1][/tmp]
>>> [if type=explicit compare=`$Scratch->{total}>= 100`]
>>> DISCOUNT for [scratch total]
>>> [discount ALL_ITEMS]
>>> $s * 0.9
>>> [/discount]
>>> [/if]
>>>
>>> That should be fine. Now my client want to display [subtotal] with
>>> out a discount and the discount on the order.
>>>
>>> Duh ..
>>>
>>> What about introducing [subtotal nodiscount=1] ?
>>
>>
>> Would be a wonderful solution IMHO.
>
> OK, I'll implement that in the next few days.

Time flies by ... but now we got [subtotal nodiscount=1] in Git.

I really don't like how we lump subtotal and discount calculation together in Vend::Interpolate::subtotal.
And why we save the subtotal into the session as latest_subtotal really eludes me. I'm looking forward
to remove this.

Regards
	Racke


-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team




More information about the interchange-users mailing list