-
Author
-
September 25, 2017 at 14:26 #174716fradesimonParticipant
Hi, Could you please provide the css code to change the Woocommerce “Out of stock” badge text to “SOLD!”.
Just to clarify i’m trying to change the ribbon text that’s displayed on the top left side of the product image and not the text displayed on the product page itself.
I have tried to use this snippet:
COPY CODEadd_filter('woocommerce_stock_html', 'change_stock_message', 10, 2); function change_stock_message($message, $stock_status) { if ($stock_status == "Out of stock") { $message = '<p class="stock out-of-stock">Sold</p>'; } else { $message = '<p class="stock in-stock">Available</p>'; } return $message;
}
But this just changes the text on the product page and not the ribbon badge.
Any help you could offer would be really appreciated. Thanks 🙂
September 26, 2017 at 09:40 #174796LauraModeratorHello have you tried using Loco Translate? It help changing theme and plugin strings 🙂
Theme strings and plugins strings can easily be changed by using Loco Translate plugin https://wordpress.org/plugins/loco-translate/
<h3>A small introduction on how translations work</h3>
Translatable strings can come from the theme or from the installed plugins. You need to translate the theme or the plugin depending on what section of the site your string is found.For example if your string is on your BuddyPress profile then most probably you will need to translate BuddyPress plugin. If you are on the Forums section of your site then bbPress plugin should be the one that needs to be translated. Another example is the rtMedia plugin that adds the Media links to BuddyPress and if you want to translate it then this plugin will contain the string.
<h3>Follow these steps to get you started:</h3>- Install Loco Translate plugin
- Go to the plugin dashboard: WP Admin – Tools – Manage translations
- Find the theme or plugin in the list.
- If the language isn’t already in the list then click Add new language, choose your language and if you are asked where you want to save the language files choose global language directory ( wp-content/languages/ ).
- Press SYNC button to synchronise your translation with the provided .pot file
- Search for the string you want to translate and add your translated string.
- Press Save when you finished your translation.
Note: You will have to set the language for your blog from WP-admin – Settings – General – Site Language – Choose your language
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
September 26, 2017 at 10:45 #174800fradesimonParticipantHi Laura,
Was this meant for me because i don’t see how this solves my issue?
September 27, 2017 at 13:50 #174939LauraModeratorHello, yes, it can be used so instead of using a function, you just change the string using a translation plugin 🙂 Let me know if you need more help, if you share access i can do it for you
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
September 28, 2017 at 14:04 #175067LauraModeratorHello, done 🙂 You can uninstall the plugin now
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
September 29, 2017 at 14:59 #175157LauraModeratorGlad to help 🙂 If you can rate us 5 stars at themeforest that would help a lot 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
-
AuthorPosts
The forum ‘Plugins questions’ is closed to new topics and replies.