2

Update 3: I just need to know how to find a Data Selector in a rule condition

In a Commerce Kickstart distribution:

To reproduce:

1) I added a billing field called: "VAT NUMBER" at: "admin/commerce/customer-profiles/types/billing/fields"?

2) I created a Sale Tax at: admin/commerce/config/taxes

3) For this new Sale Tax I clicked at "configure component" to edit the "rule component" for the tax.

4) Now inside the rule: in Conditions I need to check if the field: "VAT NUMBER" is empty

Here is my problem: I don't know which is the Data Selector to get the field: "VAT NUMBER" and make the comparation.

I found this screencast which shows how to create a conditional tax based in the address field: http://www.drupalcommerce.org/videos/tutorials/drupal-commerce-condition...

I need to do the same that is shown in the video with the only difference that the condition for the video is based in the address field and in my case I need to base the condition to the value of "VAT NUMBER"

UPDATE: This post is no the solution that I need, but it might help to put it in the right direction: http://www.drupalcommerce.org/faq/rules-field-data-selection

UPADE 2 I tried to use the condition "Entity has field" but I can't find which is the right Entity to select to get the condition to TRUE

2
  • If you add the "Commerce Customer profile" data type as a variable to be used as input parameter (under the component settings), you can use the "Entity has field" condition for the customer profile entity. However, I'm not sure this solves your problem, since it seems impossible to change the variables for a tax component.
    – arjan
    Commented Mar 17, 2014 at 17:08
  • @arjan The variables can not be edited. Look my capture: img18.imageshack.us/img18/4365/enyj.jpg
    – chefnelone
    Commented Mar 18, 2014 at 8:29

1 Answer 1

2

Found the way:

To drill to the selector I have to create 2 "entity has field" conditions.

1) entity "site:current-cart-order" has field "commerce_costumer_billing"

2) entity "site:current-cart-order:commerce-customer-billing" has field "vat_number"

then I can select the data selector

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.