When you change a product attribute on a product display page, ajax loads the fields of the new product.
See here: http://demo.commerceguys.com/ck/tops/drupal-commerce-hoodie
By changing the size, color, etc, you trigger an ajax call that changes the fields such as SKU, images, etc.
My question is, how do you add additional markup to be updated on the attribute(form field) change?
By default, the form will update all fields printed in the template in this format.
<?php print render($content['commerce_price']); ?>
This wraps markup around the price with the following classes.
commerce-product-field commerce-product-field-commerce-price field-commerce-price node-880-product-commerce-price
Im assuming the ajax call is replacing fields by looking at this markup.
So how do I add additional markup, that printed in the node template, to be replaced with ajax when a form field is changed.
Im not sure what to hook into.
Many thanks.