Plugin Author
Altos
(@sefin)
You can do it with our plug-in also.
This is an example:
function change_product_price_html($price){
$newPrice = "Text Before Price";
$newPrice .= $price;
$newPrice .= "Text After Price";
return $newPrice;
}
add_filter('woocommerce_get_price_html', 'change_product_price_html');
To make it work, you must append the code to your “/wp-content/themes/YOUR_THEME/functions.php” file.
Let me know if this solved your issue.
Well
It gives me an error
function change_product_price_html($price){
$newPrice = "Text Before Price";
$newPrice .= $price;
$newPrice .= "Text After Price";
return $newPrice;
}
add_filter('woocommerce_get_price_html', 'change_product_price_html');
functions.php on line 1088
It’s this line: “$newPrice = "Text Before Price";”
Plugin Author
Altos
(@sefin)
You should probably check for syntax errors, but we can’t tell exactly were the problem is, with this information.
What type of error it gives to you can you specify it?
Got it. It was my copy / paste skills
Sorry
HI there, sorry im new in php but need the same prefix after price (incl VAT)
where exactly should I paste this code in functions.php??
Thanks!
Plugin Author
Altos
(@sefin)
Hello!
It’s usually paste it at the end of the file.
It’s a code standalone, so It’s not linked to some particular code in the file.
We suggest to paste it at the end of the file in order to don’t mixed it with other code.
I hope this information can help you.
Let me know if the issue remains.
I’ll be waiting for your feedback.