[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ic] discount ALL_ITEMS based on DB entry


Hello Everyone,
Once again, I'm asking the list for help. On my site, I have implemented a Global discount based on variable that the client/admin can change through the admin interface. It works fine, and works just like it should according to clients original specs. Here's my code.

[if scratch threefor1act eq "y"]
[discount code="ENTIRE_ORDER" interpolate=1]$s * [scratch threefor1dis][/discount]
[elsif scratch twofor1act eq "y"]
[discount code="ENTIRE_ORDER" interpolate=1]$s * [scratch twofor1dis][/discount]
[/elsif]
[/if]

They would like to have a new column in the db called disc_exempt that they can put a value in to have it NOT included in the discount. Based on what I've understand and have read on the discount function, I should be able to do something like this.

[if scratch threefor1act eq "y"]
        [discount code="ALL_ITEMS" interpolate=1]
        return $s if [item-field disc_exempt] eq "y";
        return $s * [scratch threefor1dis];
        [/discount]
[/if]

However, I get errors that look like this.

Discount for GADAS has bad formula. Not applied.
> Can't locate object method "field" via package "disc_exempt" (perhaps you forgot to load "disc_exempt"?) at (eval 636) line 2.

So it seems to me that IC doesn't like the item-field tag inside the discount tag, however, in examples, I've seen things like item-code used inside of discount.
Has anyone implemented something like this before?


Brian Kosick
Web Programmer
New Age Consulting Service, Inc.
216-619-2000
suppressed

_______________________________________________
interchange-users mailing list
suppressed
http://interchange.redhat.com/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.