Last active
May 25, 2021 11:54
-
-
Save slavapas/c613fd3752ee29089993c7a23f274f0d to your computer and use it in GitHub Desktop.
WooCommerce - Change the content of Single Product Page - Price Variation content
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
// 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