Created
October 21, 2015 16:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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