Reputation: 15
I'm creating my multilanguage WordPress website using polylang plugin and Loco translate, but nothing happens with few lines. First "Product has been added to your cart", second is in checkout page "checkout" button,.
Maybe code exist with which I can replace this text In few languages?
I have in mind something like that
If ($lang = 'gb') {
Product has been added to your cart } else {
Other language text goes here }
Thanks for help.
Upvotes: 2
Views: 2013
Reputation: 1783
I don't have much experience with polylang, but you could probably achieve this by using polylang pll_current_language()
function, like this:
if (pll_current_language() == 'en') {
echo "Product has been added to your cart";
} else if (pll_current_language() == 'de') {
echo "Text in german";
}
Upvotes: 1