Community Forums

negate categories in coupon config

Coding & concept discussion for OpenCart v1.x development

negate categories in coupon config

Postby mondokat » Fri Feb 24, 2012 1:08 am

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?
mondokat
 
Posts: 27
Joined: Mon Feb 20, 2012 2:55 am

Re: negate categories in coupon config

Postby mondokat » Fri Feb 24, 2012 2:44 am

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?
mondokat
 
Posts: 27
Joined: Mon Feb 20, 2012 2:55 am

Re: negate categories in coupon config

Postby mondokat » Fri Feb 24, 2012 10:13 am

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?
mondokat
 
Posts: 27
Joined: Mon Feb 20, 2012 2:55 am

Re: negate categories in coupon config

Postby mondokat » Sat Feb 25, 2012 8:26 pm

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

viewtopic.php?f=110&t=29272
viewtopic.php?f=20&t=48000
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.
mondokat
 
Posts: 27
Joined: Mon Feb 20, 2012 2:55 am

Re: negate categories in coupon config

Postby tarang1906 » Sat May 05, 2012 6:39 am

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: 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!
tarang1906
 
Posts: 17
Joined: Wed Mar 07, 2012 8:41 am

Re: negate categories in coupon config

Postby tarang1906 » Tue May 08, 2012 6:52 am

I am really trying to find an answer here....but not getting any kind of help. Not a single response from the community!
tarang1906
 
Posts: 17
Joined: Wed Mar 07, 2012 8:41 am


Return to Concepts

Who is online

Users browsing this forum: No registered users and 28 guests

Hosted by Arvixe Web Hosting