Hello Prince Manfred,

I noticed, using your latest version of Commerce Extra Rules. Using the term based product quantity comparison. That when you add products that have the Taxonomy Term Id match, the products are discounted as they should be so long as they are in the quantity range as desired. However, if I add a product to the cart that does not have a term ID match (A product that I do not want to part of the quantity range discount) Then, I find adding the non qualifying product, wipes out the discount for the other products that should be discounted completely. The discount disappears. Take the offending non qualifying product from the cart and discount appears for the discounted items again. Strange

Please note however, when I tried your second zip file attachment in the Drupal Commerce forums.
Submitted by Prince Manfred on Tue, 09/27/2011 - 13:20 (On drupalcommerce.org/forum/2)
Along with standard Total product quantity comparison conditions (That I had orginally). That everything worked as it should. If I added a product to the cart that did not qualify for a quantity range discount alongside others that do. The discount did not disappear for the products that do qualify. It worked sweet, however if I even tried this setup with the latest version (Which I just did to check), it did not work, so I have tried the new way and the old way with the new version and they both didn't work for me.

I have attached a screenshot that shows how I set up one of the two conditions using your latest version that did not work as it should.

CommentFileSizeAuthor
new.gif27.59 KBjlhs

Comments

PrinceManfred’s picture

I can't reproduce the issue. I'm able to add all sorts of products from ones with a different term to ones with no terms at all. There is a new version I just uploaded. Install it and clear your sites cache a couple of times before trying it out.

jkvank’s picture

I had this yesterday but fixed it myself.
My problem occurred because the other product type didn't have the Term Reference field on it.
For this to work, all product types have to have the Term Reference field.

jlhs’s picture

Thanks both of you. Prince Manfred, I have installed your new module.

I have probably messed something up.

is commerce-line-item:order the right thing to be putting in the Data selector of the Term-based product quantity comparison?

I have these errors, if they mean anything?
Warning: fopen(/var/www/data/file4.txt) [function.fopen]: failed to open stream: No such file or directory in commerce_extra_rules_conditions_term_fields_options_list() (line 170 of /home/username/public_html/d/sites/all/modules/commerce_extra_rules_conditions/commerce_extra_rules_conditions.module).
Warning: fwrite(): supplied argument is not a valid stream resource in commerce_extra_rules_conditions_term_fields_options_list() (line 171 of /home/username/public_html/d/sites/all/modules/commerce_extra_rules_conditions/commerce_extra_rules_conditions.module).
Warning: fclose(): supplied argument is not a valid stream resource in commerce_extra_rules_conditions_term_fields_options_list() (line 172 of /home/username/public_html/d/sites/all/modules/commerce_extra_rules_conditions/commerce_extra_rules_conditions.module).

PrinceManfred’s picture

Uh oh. No that is totally my fault. I meant to remove that before uploading. I'll upload a new zip.

EDIT: It's uploaded

jlhs’s picture

Thanks Prince Manfred.

The error messages are gone with the new download.

I have the same taxonomy fields for different items. But different taxonomy terms for ones I do not want to be cross discounted. However, I am getting all items discounted that have the same taxonomy field in the product type. Regardless if they match the term I set in your custom condition or not and also quantity ranges are being ignored. This seems like your custom conditions are being bypassed completely on my setup.

PrinceManfred’s picture

Assigned: PrinceManfred » Unassigned

EDIT: Ignore this comment. Read the next one.

Can you post a screenshot of an overview of your rule so I can see the list of all conditions you have on it? It also might be enlightening if you posted screenshots of the settings for each of the conditions so we can look at the values you have set. The only thing that comes to mind right now is that something in your rule is conflicting with something else in your rule and it's causing some wacky side-effects. I'll keep mucking around trying to reproduce the results.

PrinceManfred’s picture

Assigned: Unassigned » PrinceManfred

Ignore the screenshot request. I've uploaded a new version and I'm 95% sure that it's going to fix your issue. The module was having some trouble if you mixed different product types and some of the product types didn't have the term field you're checking for. It now looks to see if the field exists and acts accordingly instead of silently dying in the background. Sorry we're having so much trouble getting this working, but you are helping us weed out all kinds of issues : ). Let me know how it goes.

jlhs’s picture

Assigned: Unassigned » PrinceManfred

Hello Prince Manfred.

I did have mixture of product types. I am still getting discount crossover on all products regardless of terms. I notice the quantity ranges are working for the products I want to discount, but once different items from different product types are added to the cart that I did not want discounted. Then the discount will remain on the quantity range of the items that should be discounted. But any items that should not be discounted from different product types will also be discounted but with no quantity range limit at all. However if the products that should be discounted are out of their range. The products lose their discount as they should and they products that should not have been discounted in the first place also lose their discount at the same time.

Even the different product types, I currently have sharing the same machine named term reference, the same field. They just have different terms is all. Thought this would be easier for testing.

A problem could be (For all I know) that I still have the commerce price table project activated on my test Drupal installation, it will not allow me to uninstall it, this could be causing conflict. I am going to make a fresh Drupal and Drupal Commerce install soon, I will do some testing and see how your module goes on that and report back to you.

Thanks for the hard work you have put into this project. I am happy to test and retest.

PrinceManfred’s picture

Do you also have a "Line item product has term" condition in your rule? That's the condition that actually limits the discount to only being applied to products with the specified term. "Term-based product quantity comparison" just adds up the quantity of matching products. If it is used by itself it will apply the discount to the whole order. Actually, I think it will apply the discount to the whole store.

jlhs’s picture

Thankyou Prince Manfred!

Works perfectly now.

I thought that since The term being checked for is in the quantity comparison. That Line item product has term condition was not needed anymore.

I have added Line item product has term alongside the quantity range comparisons and it all works very well.

Thankyou for making this excellent module : )

Also you should put a link to the project under the add-ons menu on the drupalcommerce.org website.

PrinceManfred’s picture

Status: Active » Fixed

I'm glad we could get this working. Thanks for hanging in there and helping me work out these bugs. I think it's in a useable state now so I'll see about adding it to the plugins page.

EDIT: The module is now on the addons page at drupalcommerce.org

jlhs’s picture

Good stuff. Have given it 5 stars.

PrinceManfred’s picture

Status: Fixed » Closed (fixed)
PrinceManfred’s picture

Issue summary: View changes

just some clarification