close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How to include product specific discounts to my current cart..??

Thread began 7/22/2011 12:38 am by angelleye | Last modified 7/22/2011 5:28 pm by angelleye | 1456 views | 6 replies

angelleye

How to include product specific discounts to my current cart..??

I've got some discounts already setup and working great in my eCart (you guys helped me with that awhile back, actually).

My database stores the discount code data and I have session vars for DiscountCode, DiscountType, and DiscountAmount.

Then I have 2 separate discount rules setup in eCart: one for the flat rate type and another for percentage based type. The flat rate rule just uses the flat rate amount set in the DiscountAmount session. The percentage rule takes the DiscountAmount times the cart's subtotal.

I'd like to add the ability to include discount codes in my system that only apply to certain items. For example, if we're going to do a special on one product we don't want people getting 10% off everything in their cart...just that one line item. We have plenty of codes that do pertain to an entire card, though, so I need both to function.

This probably isn't the best way to do this, but I added a single field into my discount codes db table called product_ids. I'm simply adding the ID's of any products I want this coupon to work for separated by commas. Then I have those available in my "apply discounts" script so I can loop through them and handle it accordingly.

I just don't want to get too far with that and figure out I should do it an entirely different way. Should I go with a separate table that just stores related products to discount codes, or can I work with what I'm doing here?

Either way, some advice on the best plan of attack would be greatly appreciated. Thanks!!!

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...