/**
* Show short code after price on single product
*/
function cw_change_product_price_display( $price ) {
$price .= do_shortcode('[xyz]');
return $price;
}
//add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
oder
add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
add_filter( 'woocommerce_cart_item_price', 'cw_change_product_price_display' );
function cw_change_product_price_display( $price ) {
// Your additional text in a translatable string
$text = __('TEXT');
// returning the text before the price
return $text . ' ' . $price;
}
Quelle: https://stackoverflow.com/questions/47016425/add-a-custom-text-before-the-price-display-in-woocommerce
Schreibe einen Kommentar