Post by mondokat » Fri Feb 24, 2012 2:08 pm

This seems like a simple concept, so maybe it's come up before. I have a need to negate a category from being valid for a coupon code. For example, I have a category called "clearance" that has all clearanced out items and I want a coupon code to be valid for all products except the clearance category. Anybody know an easy way to do that?

New member

Posts

Joined
Mon Feb 20, 2012 3:55 pm

Post by mondokat » Fri Feb 24, 2012 3:44 pm

Looks like the category selector control uses jquery to add appropriate products to the product list control below it. It subtracts when you uncheck the category. i wonder what logic is used to join selections when a product has multiple categories assigned to it?

New member

Posts

Joined
Mon Feb 20, 2012 3:55 pm

Post by mondokat » Fri Feb 24, 2012 11:13 pm

ok, i stared at the code a while and the database schema and then slept on it. It looks like coupon codes only are applied to products and never categories. The category selector on the coupon code page only auto-fills the product list based on the category contents AT THAT TIME. so if the category contents change, the coupon code would need to be refreshed. That's an even worse problem than not being able to say "use this category but not that category".

How are other people using coupon codes?

New member

Posts

Joined
Mon Feb 20, 2012 3:55 pm

Post by mondokat » Sun Feb 26, 2012 9:26 am

I see several other people bumping into trouble with this stuff. Here's a few threads on it:

http://forum.opencart.com/viewtopic.php?f=110&t=29272
http://forum.opencart.com/viewtopic.php?f=20&t=48000
http://forum.opencart.com/viewtopic.php?f=88&t=54344

I'm sure there are more. The main issue here is that the "category" widget on the coupon codes page is just a way to "fast edit" the product list on the page, and this information is never stored in the backend (obvious, if you save a category on the product page, leave and come back, it's not checked anymore, but the products are still in the list), and internally the coupon codes are always only applied to products and not categories. It seems like there should be a way to fix this, maybe even with a vqmod. I'm going to give a shot at it tonite and see what I can do. I'll probably start a new thread to follow my progress, since it is definitely a different topic than this thread. Maybe if I can make opencart REALLY pay attention to categories in terms of coupon codes, it might be easier to make it "negate" categories as well.

Honestly, not having coupon codes use categories in the core product should be a non-starter for damn near everyone these days. Silly it's not there.

New member

Posts

Joined
Mon Feb 20, 2012 3:55 pm

Post by tarang1906 » Sat May 05, 2012 7:39 pm

Hi mondokat,

That is a very correct issue you pointed out. I am facing a very different issue here..

When I create a new coupon and select a particular category for it, instead of products from Only that category, ALL the products from ALL the categories are getting added to the "product" section.

I have posted a thread on this here: http://forum.opencart.com/viewtopic.php?f=161&t=61918

But nobody seems to notice it or bother to provide any help..After going through your post, i thought you have a good knowledge of how coupon products are getting added and what i must be missing which is causing me above issue.

I am using OC 1.5.1.3 and have compared original files with my source files(view,controller & model files)..they are identical. Is there any other file being called from system->library or javascript file that i might be missing?

Please give me some clue...Thank you very much in Advance!

Newbie

Posts

Joined
Wed Mar 07, 2012 9:41 pm

Post by tarang1906 » Tue May 08, 2012 7:52 pm

I am really trying to find an answer here....but not getting any kind of help. Not a single response from the community!

Newbie

Posts

Joined
Wed Mar 07, 2012 9:41 pm
Who is online

Users browsing this forum: Bing [Bot], RuslanBrest and 66 guests