I have a view and have a relationship so I can display the product price. When I change an attribute option, the price field doesnt dynamically change.

I think I will have to do something with the style settings and change to DIV, check create a CSS class and add a tokenized CSS class so it will change when the product id changes? but i cant get it to work.

What I've done so far:

  1. Add relationship Content: Referenced products
  2. I have 3 fields: 1. content nid (excluded from display) 2. product add to cart form. 3. commerce product price field.

At this point i can display the price but it doesnt update when i select various attribute options

  1. Style Settings, Customize field HTML --> DIV --> Create a CSS class

I think under the create a CSS class i need to print a CSS class with a product id token or something like that, but cant find the correct token or CSS valule.

1 Answer 1


Found it:

  1. you must add a content: NID field and exclude from display to get the token of [nid] available
  2. Then under style settings of the price field, select 'customize field HTML'
  3. HTML element = DIV
  4. Select Create a CSS class
  5. the CSS class for Price is: node-[nid]-product-commerce-price

The NID token will update when a certain attribute changes. This can also be applied to other fields as well finding the CSS with firebug and then adding in the [nid] token

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.