Jump to content


Replying to Create An Update-Safe Change To "buy Now" Button


Post Options

  or Cancel


Topic Summary

Elise Alley

Posted 17 March 2014 - 02:31 PM

Hi Ray,

LION is just an internally used code.  The code I gave you will work both on development and live sites.  If you look into the Exchange files, you'll see it called throughout the code.  

Let us know if you have any additional questions.

Thanks,

Elise

Ray @sixfourweb

Posted 16 March 2014 - 05:41 PM

Elise - Thanks it works.  Can you explain the highlighted conditional?

 if ( 'LION' === $domain || 'it-l10n-ithemes-exchange' === $domain )

The site is currently on a development server. When I move to production, what does the 'LION' in the code represent?

Elise Alley

Posted 14 March 2014 - 02:11 PM

Hi Ray,

I apologize that your post was missed originally.  

Try adding this code to the bottom of your child theme's functions.php file before the closing ?> and see how it works for you:

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 'Buy Now' :
								$translated_text = 'Donate Now';
								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.  And I apologize again that your post was missed previously.

Thanks,

Elise

Ray @sixfourweb

Posted 14 March 2014 - 12:18 PM

Bueller? Bueller? Anyone?

Ray @sixfourweb

Posted 09 March 2014 - 04:41 PM

Is there a way to change the "Buy Now" button in a way that is persistent via the exchange templates? I"m building a donation site, where the method of using the Free Offer add-on is viable, however I need to be able to prompt specific dollar amounts in another donation option, as a result the "Buy Now" is present.

Here's a link to the demo site. http://leo.thesinglepreneur.com/make-a-donation/

You can see that for the one-time donation, where there is no specified or suggested donation amount, the transaction button is "Donate Now". In the Monthly donation where the donor is prompted to select a suggested a donation amount (which is greater than $0.00), the transaction button reads "Buy Now".

Is it possible to make a create a new template for inclusion into the child theme folders that would survive updates to Exchange?

Review the complete topic (launches new window)