Hey @davedenis
In some cases (like this one), you are probably better off using context in the snippet as well.
You could apply the following snippet in the functions.php file of your theme (without the PHP tag at the top): https://gist.github.com/andrasguseo/29903a974cb84060957881c17613c278
Cheers,
Geoff B.
Thanks @geoffbel I did try this. I copied the gist and changed just the key/value pair I wanted to replace which is the “Out of stock” text. I did not work. I tried a different string on the page which was “RSVP” and that did change. Is it possible that the “Out of stock” string doesn’t change because it’s inside of a table tag in the HTML?
Good evening @davedenis,
There could be a couple of reasons for that.
The most important one being to use the exact same string as the one found in the language file.
In this example, the string to replace is not “Out of stock”, but rather “Out of stock!”.
I highly recommend reading the 3 following articles on translation:
• https://theeventscalendar.com/knowledgebase/translating-the-events-calendar/
• https://theeventscalendar.com/knowledgebase/how-to-override-plugin-language-files/
• https://theeventscalendar.com/knowledgebase/incomplete-translations/
Let me know how that goes.
Best regards,
Geoff B.
Hi @geoffbel – I did try the string ‘Out of stock!’ with no success…
I guess I could add a little jQuery to the page to replace the text, this just seemed more like the right way in WordPress.
Hi @davedenis
Instead of the snippet you can also try this plugin.
String: “Out of stock!”
Domain: “event-tickets”
Context: (leave empty)
Hope this helps!
Cheers,
Andras
Hi @davedenis
Did you manage to get this straightened? Do you need further help with this or can we close it as resolved?
Thanks in advance for getting back to us.
Cheers,
Andras
Hi @aguseo thanks for checking in. I will close this. I ended up using jQuery to change the text, even the plugin you recommended wouldn’t change that particular bit of text, even though it worked on other text on the page in my testing.
Thanks for the reply @davedenis!
Sorry to hear it didn’t work. I have also encountered some strings that I couldn’t get to change but “Out of Stock!” worked for me. Not sure what could be the issue.
Anyway, I’m happy to hear you found another solution. If might be helpful to other users as well if you could share it here.
Cheers,
Andras