Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save slavapas/c613fd3752ee29089993c7a23f274f0d to your computer and use it in GitHub Desktop.
Save slavapas/c613fd3752ee29089993c7a23f274f0d to your computer and use it in GitHub Desktop.
WooCommerce - Change the content of Single Product Page - Price Variation content
// Change the content of Price Variation content
add_filter('woocommerce_available_variation', 'variation_price_custom_suffix', 10, 3);
function variation_price_custom_suffix($variation_data, $product, $variation) {
$variation_data['price_html'] .= ' <span class="price-suffix">' . __("each", "woocommerce") . '</span>';
$var1 = $variation_data['availability_html'];
var_dump($var1);
foreach ($var1 as $var) {
var_dump($var);
}
// var_dump($variation_data);
return $variation_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment