Image style depending on stock level How can i change the image style for a product (variation) when the stock level has reached "Out of stock" level? Would be great to add a badge to the product image saying "SOLD". Thanks! Log in or register to post a comment. timbraeckman Posted: Nov 13, 2013 Comments Changing field formats based on stock Josh Miller on November 13, 2013 1) Download the following modules: https://drupal.org/project/commerce_stockhttps://drupal.org/project/ffchttps://drupal.org/project/field_formatter_settingshttps://drupal.org/project/imagecache_actions 2) Enable the following modules: Commerce Stock UI Commerce Simple Stock Commerce Simple Stock Rules Imagecache Actions Imagecache Canvas Actions Field formatter conditions Field formatter settings API Or run this drush command: $ drush en imagecache_canvasactions, commerce_stock_ui, ffc -y ** Don't forget to manually enable Commerce Simple Stock and Commerce Simple Stock Rules 3) Configure your product so it has images and real stock values 4) Create a new image style 5) Add a rule that reacts on the event "field is being rendered" and has a condition of "data comparison" on the product's commerce_stock field and an action of "change image style." 6) Change the image style formatter to have a condition of "use an event rule" and then select your new rule that you created. 7) Profit! Log in or register to post a comment. Anyone got this to work in timbraeckman on December 2, 2013 Anyone got this to work in Commerce Kickstart v2? I can't seem to do this. Very weird :-( Log in or register to post a comment. Yeah, it works in ck v2. minoxes on April 27, 2016 Yeah, it works in ck v2. Log in or register to post a comment.