Hi, I still can not figure out how to create a rule that assigns taxonomy terms to a product display. Below is what I'm trying to achieve, please help.
I have a taxonomy vocabulary that has some custom fields or terms. I will use those custom fields or terms to populate the Product Display terms to create my catalog of products. I need to set up a single rule, if possible, that creates the products after a new term was added to this particular vocabulary. Is that possible? Please notice that I want to automatically pass the values from the newly created term over to the product display terms.
1) I set up a rule that "After saving a new term", it creates an entity type: Commerce Product, SKU: [term:name]. It creates two different product types/variations.
Term: MY-TITLE
Products created:
MY-TITLE-1 (Product variation 1)
MY-TITLE-2 (Product variation 2)
2) I need the same rule or a new one, to automatically create the product display with the product variations from above and assign the respective terms from the newly created term.
Product display title: MY-TITLE
Add existing product variations to the product display: the products I created in 1).
Assign taxonomy terms to the product display using the taxonomy or text fields values from the new term I added.
Note: All I was able to get working is the rule that creates the products, then creates a product display but only the product display node with the title, without any fields or product references.
I need some guidance on how to populate the product display with the existing product variations and also how to assign the taxonomy terms to the product display.
The idea is to create the products automatically, either via rules or via a custom module. Please advice. Thanks.
Comments
Comment #1
luthien commentedI used custom PHP code to create the product display node and to assign the taxonomy terms. Now I need to figure out how to assign all the product variations to the product display node automatically.
Comment #2
rszrama commentedSorry, luthien, we don't offer Rules configuration support in this issue queue. Your best bet, since I believe you'd benefit from real-time support, is to join the #drupal-commerce or #drupal-rules (I believe that exists) IRC channels to understand how to make Rules do what you want. I also highly recommend the Rules Mastery videos available for free on YouTube.
Comment #3
luthien commentedHi, I understand; but I'm sure what I'm trying to implement will benefit others as well. I created the rule that populates all that I need, including taxonomy terms, except for assigning all the line items to a product display.
Once the product display node was created, assigns the products to it. There is not a 1-1 relation, one product display can has more than 2 products.
Solution listed below for my second rule:
Comment #4
rszrama commentedIt's for the benefit of others that we don't use the queue. If you'd care to pursue it in a forum where we're actively working to make answers to common questions discoverable, please use http://www.drupalcommerce.org/questions.
Comment #5
luthien commentedYes, I followed your initial advice and I posted the issue at: http://www.drupalcommerce.org/questions/8159/assign-products-product-display-node-using-rules. Not every module has an independent website or channel, like yours, to post questions.
Comment #6
rszrama commentedI understand, that's why we link to it in the issue submission guidelines. : )
Comment #7
adepentane commentedPlease any help on this issue. Having this same challenge with Drupal Comerce module in drupal. Please kindly assist. THANKS>