Skip to content
Advertisement

Woocommerce: add text before add-to-cart only on specific single product pages

I found the following code in order to display text before the add-to-cart-button on a single product page:

JavaScript

This works perfect!

However, I would like to show this message not only on one product page (by id), but on several product pages (by serveral ids), therefore I have to insert multiple ids. How does the above code have to changed, in order to achive this? From my barely knowledge I think that one have to insert so called arrays – but unfortunately, I do not know how to code this…

Advertisement

Answer

if you want to use it with the help of an array then use it like this

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement