Skip to content

Instantly share code, notes, and snippets.

@yehudaTiram
Last active April 9, 2018 06:10
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 yehudaTiram/9f4006c885c9d65edd01873262db4c7b to your computer and use it in GitHub Desktop.
Save yehudaTiram/9f4006c885c9d65edd01873262db4c7b to your computer and use it in GitHub Desktop.
Using filters to change ATR Woo Global Price Options plugin display of price options list in single product page
/* https://wordpress.org/plugins/atr-woo-global-price-options/ */
/* You can use this filters to change the display of the price options list */
/* Note the different filters for each part */
/* For the Header */
add_filter( 'atr_gpo_before_price_options', 'test_before_price_options', 20 );
function test_before_price_options(){
$price_options_header = '<div class="atr-price-options-wrap"><p class="gpo-before-price-options">THIS IS THE HEAD OF THE LIST</p>';
return $price_options_header;
}
/* For list item open tag */
/* Will affect only radio button list display */
add_filter( 'atr_gpo_before_price_options_radio_item', 'test_atr_gpo_before_price_options_radio_item', 20 );
function test_atr_gpo_before_price_options_radio_item(){
$price_options_before_radio_item = '<div class="before_price_options_radio_item">';
return $price_options_before_radio_item;
}
/* For list item closing tag */
/* Will affect only radio button list display */
add_filter( 'atr_gpo_after_price_options_radio_item', 'test_atr_gpo_after_price_options_radio_item', 20 );
function test_atr_gpo_after_price_options_radio_item(){
$price_options_after_radio_item = '</div>';
return $price_options_after_radio_item;
}
/* For the footer of the list */
add_filter( 'atr_gpo_after_price_options', 'test_after_price_options', 20 );
function test_after_price_options(){
$price_options_footer = '<p class="gpo-after-price-options">THIS IS THE FOOTER</p></div>';
return $price_options_footer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment