![]() I have a Content type "Event" that has a Product reference field "Register". I'm using Drupal 7, commerce, registration, and commerce_registration. I cannot get the field to show up in the rules conditions. I am attempting to use rules to modify the price of a product based on the value of a field in a referenced entity. Question: How can I get fields from 2-deep referenced entities into scope for "Product pricing rules"? I hope this is the proper place to ask a question. I think it would be helpful to have this listed in one place for easy reference. For example targeting line items where it contains the "commerce_product" field means the line item is a product entry, verses a line item that contains a "commerce_customer_address" as this would be a customer profile item. Select the field that is the unique or required for the entity. Target the "base" entity type that is in scope. In order for you to even target a commerce entity you must make sure the event is appropriate to the objects you want to manipulate.Īdd a condition of type "Entity has field" That way developers can understand how to properly scope the entities that they want to manipulate.įor those watching at home, I'm talking about: ![]() What would be great to list in a table would be all of the unique fields each entity depends on (especially all of the line item types). This post is really important, especially for anyone trying to write rules to impact taxes, shipping, product prices, etc. Additionally, you could just write a custom condition / action or use a PHP condition / action through the Rules UI to access the field data directly. If you need to apply a workaround and don't have time to wait, you might glean some advice from this comment by EndEd in an issue pertaining to tax rules. Your best bet will be to follow along in the issue waiting for it to be solved in Rules: The workaround to this is to use Rules components to access field data on the referenced entities, but this method is really only feasible for advanced Rules users with a programming background. fields on the product reference by a line item in a product pricing rule), Rules will not acknowledge the existence of fields on the referenced entity. In instances where you're looking for fields on an entity referenced by another entity (e.g. ![]() Unfortunately, there's also a bug in Rules that may account for the lack of fields in your data selector.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |