Jump to content


Better, More Convenient, Private Support for Your iThemes Products Is Here.


We're moving support away from the forum and in to private tickets - Log In to Get Support Here


Note: any currently open support threads in the community forum will stay open while we resolve them.

Replying to Is There A Way To Change The Inventory Message?


Post Options

  or Cancel


Topic Summary

Ronald

Posted 12 March 2015 - 10:34 AM

Guest_Ken, please don't post the same request several times. This may cause more than one moderator spending time on the same question, and as such is not efficient use of our resources.

thanks,
Ronald

Posted 12 March 2015 - 08:35 AM

Hi, I'm going to jump in here with a related issue  - any way to change the color/size of the default "out of stock" message?

Elise Alley

Posted 05 June 2014 - 04:13 PM

Happy to have helped, tblocke!

Let us know if you have any other questions!

Thanks,

Elise

cjdeboer

Posted 05 June 2014 - 04:11 PM

That's what it was...works perfectly!

Thanks again!

Elise Alley

Posted 05 June 2014 - 03:37 PM

Hi tblocke,

It's working on my site:

Screen Shot 2014-06-05 at 4.34.57 PM.png

I think some of the apostrophes might have not converted correctly to plain text when I pasted into this post, though, so try this:

function my_translated_text_strings( $translated_text, $untranslated_text, $domain ) {
$translated_text = $untranslated_text;
if ( 'LION' === $domain || 'it-l10n-ithemes-exchange' === $domain ) {
switch ( $untranslated_text ) {
case 'Product is currently out of stock.' :
$translated_text = 'This course is full.';
break;
}
}
return $translated_text;
}
add_filter( 'gettext', 'my_translated_text_strings', 10, 3 );
add_filter( 'ngettext', 'my_translated_text_strings', 10, 3 );

If that doesn't work for you, it might be an issue on your site.  Can you please (always :)) provide us with the URL for your site?

Thanks,

Elise

cjdeboer

Posted 05 June 2014 - 03:30 PM

Thanks for the code.  Unfortunately, all pages on the site go blank (white, no errors) when adding this code.

Elise Alley

Posted 05 June 2014 - 03:13 PM

Hi tblocke,

There isn't an option to do this in the Product Variants add-on.  

I do have some code that may work for you though.  Try adding this to the bottom of your child theme's functions.php file (before the closing ?> if there is one):

function my_translated_text_strings( $translated_text, $untranslated_text, $domain ) {
$translated_text = $untranslated_text;
if ( 'LION' === $domain || 'it-l10n-ithemes-exchange' === $domain ) {
switch ( $untranslated_text ) {
case 'Product is currently out of stock.' :
$translated_text = ‘This course is full.’;
break;
}
}
return $translated_text;
}
add_filter( 'gettext', 'my_translated_text_strings', 10, 3 );
add_filter( 'ngettext', 'my_translated_text_strings', 10, 3 );

Give that a try and let us know how it goes.

Thanks,

Elise

cjdeboer

Posted 05 June 2014 - 02:22 PM

Hi,

Instead of displaying "This product is out of stock" when the inventory becomes 0, is there a way to customize this message?

For example, if running an online course, have it display "This course is full".

Thanks.

Review the complete topic (launches new window)

Better, More Convenient, Private Support for Your iThemes Products Is Here.


We're moving support away from the forum and in to private tickets - Log In to Get Support Here


Note: any currently open support threads in the community forum will stay open while we resolve them.