Jump to content


Welcome to the forum:

Welcome to the iThemes, PluginBuddy and WebDesign.com forum. We've created several tutorial video's to help you get you started with using the forum, please check them out!

Also take note of the forum guidelines.


Support hours:

Our moderators actively respond to forum support requests during normal business hours which are Monday-Friday, 8am - 5pm Central Standard Time, typically within one business day. Although some moderators choose to work during the weekends, we can not guarantee immediate attention to your requests. Thanks for understanding.

What is included with support:

Premium support includes theme/plugin issues such as: bugs encountered under normal operation, how to use basic features, basic WordPress help, and basic help with customization (meaning we point you to resources and will help in more depth as time allows). More information.

information

Is There A Way To Change The Inventory Message?



7 replies to this topic

#1 cjdeboer

cjdeboer

    Member

  • Members
  • PipPip
  • 16 posts

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.

#2 Elise Alley

Elise Alley

    iThemes Support

  • Administrators
  • Others: All Plugins, All Themes, Members, Moderators, Toolkit, Webdesign
  • 6,430 posts
  • LocationOklahoma City, OK

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

#3 cjdeboer

cjdeboer

    Member

  • Members
  • PipPip
  • 16 posts

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.

#4 Elise Alley

Elise Alley

    iThemes Support

  • Administrators
  • Others: All Plugins, All Themes, Members, Moderators, Toolkit, Webdesign
  • 6,430 posts
  • LocationOklahoma City, OK

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

#5 cjdeboer

cjdeboer

    Member

  • Members
  • PipPip
  • 16 posts

Posted 05 June 2014 - 04:11 PM

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

Thanks again!

#6 Elise Alley

Elise Alley

    iThemes Support

  • Administrators
  • Others: All Plugins, All Themes, Members, Moderators, Toolkit, Webdesign
  • 6,430 posts
  • LocationOklahoma City, OK

Posted 05 June 2014 - 04:13 PM

Happy to have helped, tblocke!

Let us know if you have any other questions!

Thanks,

Elise

#7 Guest_Ken_*

Guest_Ken_*
  • Guests

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?

#8 Ronald

Ronald

    Forum Admin

  • Administrators
  • Others: All Plugins, All Themes, Moderators, Webdesign
  • 32,647 posts

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

Join the iThemes Builder Community on Google+.



To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. Please also read the forum guidelines.



When asking your question/posting your request on the forum, please be as concise and specific as possible. The shorter your request, the more to the point, the more specific, the easier it will be for us to try and help out.




Reply to this Topic


ATTENTION
If this topic is marked RESOLVED or INFORMATION, or if you are NOT experiencing EXACTLY the same issue, please start a new topic to provide the details of your problem. If the solution provided doesn't work for you, you should start a new topic. If you feel this thread contains relevant information, you may include a link to it in your new topic. To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. When posting your question or request on the forum, please be as concise and specific as possible. The shorter and more to the point you can make your request, the better.

For BackupBuddy related issues, be sure to include the status log from your most recent backup.

CLICK HERE to start a new topic in the Exchange ecommerce plugin forum.


  



Also tagged with one or more of these keywords: information

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users