We have multiple top-level categories on a client's store. We're trying to create a coupon that applies to one of these top level parent categories and all of its children and grandchildren.

There are probably 25+ subcategories and it's very time intensive to select them all via the individual text box / autocomplete setup.

Is there any way to switch the term selection to be recursive?

Failing that, is there any way to modify the term selection to use a multiple select box of all terms, similar to what I've seen in other modules (uc_discount_alt)?

What's the benefit of having the separate, individual text boxes for terms?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wodenx’s picture

See also #1121516: Taxonomy term ID dropdown cannot distinguish duplicate terms. I agree with longwave that the best solution would be to support Hierarchical select - this has been on the to-do list for quite some time, but have been too busy to implement. As always patches/sponsorship welcome.

millenniumtree’s picture

Issue summary: View changes
FileSize
2.71 KB

Attached is a patch that adds (configurable per coupon) the ability to include child terms in the coupon.
You just select the parent terms, and check the box labeled "Also apply/exclude discount for children of the terms below"

Example terms:

Apparel
- T-Shirts
- Sweatpants

If you add 'Apparel' to the coupon, and check the box, then all T-shirts and Sweatpants will also be discounted.

mahimajulka’s picture

The above patch works like a charm.. Just one thing, instead of taxonomy_get_term function use taxonomy_term_load for DRUPAL 7

hockey2112’s picture

Version: 6.x-1.7 » 7.x-3.x-dev

Hi, I am in need of this feature for Drupal 7. I tried the patch from #2 and the suggested edit from #3, but it is not having any effect. Any recommendations on how I can make this work?

hockey2112’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
hockey2112’s picture

Version: 7.x-2.x-dev » 7.x-2.1-alpha7

(sorry for the version changes, my mistake)

hockey2112’s picture

Here's the workaround I am now using:

  1. Create a new taxonomy parent called "Exclude from coupon" with a child term called "Exclude from coupon".
  2. Add a term reference field to the Product content type for this new taxonomy. Checkbox, "unlimited" values.
  3. Check that box on any product in any of my various "on sale" sub categories that I want to exclude from specific coupons (I created a View with VBO to add this "term" in the new field on those 1000+ products).
  4. Exclude the "Exclude from coupon" taxonomy term in the coupon settings.
  5. Select "Apply discount to: Total of matching product(s)" in the coupon settings.