-2

I am trying to create a custom Commerce price multiplier rule, based off of a content type field, that holds the multiplier value.

I add the "entity has field" condition, from the content type, with the data selector "commerce-line-item" ,but when I go to add the action, with "calculate a value", the custom field isn't in the data selector options. And the "entity is type" doesn't include the content types; just "node"

--- So does anyone know how I could access a field in a content type through rules to use as a multiplier? I'm a web developer, so I could write some code if there is no other way, but it would be nice not to have to, and at least be headed in the right direction to know how I need to write.

--- And if anyone knows of an easier way to price per product without a rul

Here is what is in the data selector listing (I should have one that includes the content type field "field_deal_price"):

site:current-user:uid
site:current-user:last-access
site:current-user:last-login
site:current-user:created
site:current-user:roles:
site:current-user:status
site:current-user:profile-main: site:current-user:profile-business: site:current-user:profile-customer: site:current-date
site:current-cart-order:order-id
site:current-cart-order:created Date created
site:current-cart-order:changed Date changed
site:current-cart-order:uid site:current-cart-order:owner:
site:current-cart-order:commerce-line-items:
site:current-cart-order:commerce-order-total:
commerce-line-item:line-item-id Line item ID
commerce-line-item:order-id
commerce-line-item:order:order-id
commerce-line-item:order:created
commerce-line-item:order:changed
commerce-line-item:order:uid
commerce-line-item:order:owner: commerce-line-item:order:commerce-line-items:
commerce-line-item:order:commerce-order-total:
commerce-line-item:quantity commerce-line-item:created
commerce-line-item:changed commerce-line-item:commerce-unit-price:amount
commerce-line-item:commerce-total:amount
commerce-line-item-unchanged:line-item-id commerce-line-item-unchanged:order-id commerce-line-item-unchanged:order:order-id commerce-line-item-unchanged:order:created commerce-line-item-unchanged:order:changed commerce-line-item-unchanged:order:uid
commerce-line-item-unchanged:order:owner:
commerce-line-item-unchanged:order:commerce-line-items: commerce-line-item-unchanged:order:commerce-order-total:
commerce-line-item-unchanged:quantity
commerce-line-item-unchanged:created
commerce-line-item-unchanged:changed
commerce-line-item-unchanged:commerce-unit-price:amount commerce-line-item-unchanged:commerce-total:amount

1
  • What Drupal version? Please tag your question with a Drupal version.
    – leymannx
    Commented Jan 13, 2017 at 16:01

1 Answer 1

0

I've noticed that if I add two "has field" entries back to back then do a data comparison, sometimes only the second "has field" is available in the data comparison. What I do is add the first "has field" and then do the data comparison, then add the second has field. I'm not sure if this is related, since you are adding actions, but I hope it helps.

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.