Skip to content

Instantly share code, notes, and snippets.

@joshmiller83
Created October 21, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshmiller83/68f7fe88928e022fb700 to your computer and use it in GitHub Desktop.
Save joshmiller83/68f7fe88928e022fb700 to your computer and use it in GitHub Desktop.
A quick example of using theme_field to change the price field right before being rendered.
<?php
/**
* Implements theme_field()
*/
function THEMENAME_field__commerce_price($variables) {
if ($variables['items'][0]['#markup'] == '$0.00') {
return '<div class="commerce-product-field field-commerce-price sr-only">Call for pricing.</div>';
} else {
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment