Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1283728

    newskywebsites
    Participant

    Hi there,

    site: http://newsite.benfranklincraftswi.com
    checkout page: http://newsite.benfranklincraftswi.com/checkout/

    I need to edit the text that appears on the woocommerce checkout page so instead of just saying “I’ve read and accept the terms & conditions *” It also says “I agree that I meet the prerequisites (if any) for this class and understand that class fees are non-refundable.”

    How can I do that?

    Thanks!
    Dawn

    #1283729

    newskywebsites
    Participant

    ** Latest version of everything except WP 4.6.1

    #1284119

    Rupok
    Member

    Hi Dawn,

    I can’t see any product on your shop so can’t get into the Checkout page. Would you point us a product URL so that we can add it to cart?

    Thanks!

    #1284558

    newskywebsites
    Participant

    I apologize. Here is a product url you can add to the cart: http://newsite.benfranklincraftswi.com/product/ticket-test-paid-event-sample-20161130/ after you proceed to checkout, you’ll see the terms checkbox where I need to edit the text (screenshot attached).

    Thanks!!
    Dawn

    #1284677

    Thai
    Moderator

    Hi Dawn,

    Please add the following code under functions.php file locates in your child theme:

    add_filter('gettext', 'x_translated_text' );
    function x_translated_text($translated) { 
    	$translated = str_ireplace('I&rsquo;ve read and accept the <a href="%s" target="_blank">terms & conditions</a>', 'I agree that I meet the <a href="%s" target="_blank">prerequisites</a> (if any) for this class and understand that class fees are non-refundable.', $translated);
    	return $translated; 
    }

    Hope it helps 🙂

    #1284689

    newskywebsites
    Participant

    Oh I wish so hard that would have worked, but I cleared my cache and nothing changed. did I do it right? See screenshot. Other ideas? I’ll send my login in case you need it…

    Thanks so much!
    Dawn

    #1284692

    newskywebsites
    Participant
    This reply has been marked as private.
    #1284765

    Thai
    Moderator

    Hi Dawn,

    I updated the code to this:

    add_filter('gettext', 'x_translate_text' , 20, 3);
    function x_translate_text ( $translated_text, $text, $domain ) {
    	$translation = array (
    		'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms & conditions</a>' => 'I agree that I meet the <a href="%s" target="_blank">prerequisites</a> (if any) for this class and understand that class fees are non-refundable.',
    	);
    
    	if( isset( $translation[$text] ) ) {
    		return $translation[$text];
    	}
    	return $translated_text;
    }

    It’s working fine.

    Regards!

    #1284778

    newskywebsites
    Participant

    Wow! Thanks so much! You guys truly are amazing!!!! We’re soooo close. Can you look at the screenshot? Any chance we can still have the “agree to terms and conditions PLUS the text we added? and for the checkbox to appear next to the text instead of above it?

    Thank you!!
    Dawn

    #1284866

    Thai
    Moderator

    Hi There,

    Please add the following CSS:

    .form-row.terms.wc-terms-and-conditions {
        margin-bottom: 15px !important;
        float: left;
        width: 100%;
    }
    .form-row.terms.wc-terms-and-conditions input#terms,
    .form-row.terms.wc-terms-and-conditions label.checkbox {
        float: left;
        margin-right: 8px;
    }
    .form-row.terms.wc-terms-and-conditions label.checkbox {
        width: 95%;
        margin-right: 0;
        font-size: 15px;
    }

    Hope it helps 🙂

    #1284880

    newskywebsites
    Participant

    Thanks for your patience and help. That code brought the text up to the same line as the check box. Thanks! However, it still isn’t showing the original Terms text. I’d like it to still show both sentences with the link being on the “terms” text. I see that in your php, but it’s not showing up (see latest screenshot attached).

    It should have a checkmark, then: I’ve read and accept the terms & conditions. (link to http://newsite.benfranklincraftswi.com/contact-ben-franklin-crafts/terms-policies/) I agree that I meet the prerequisites (if any) for this class and understand that class fees are non-refundable.

    Thanks!!
    Dawn

    #1285186

    Lely
    Moderator

    Hello Dawn,

    Please update the code to the following:

    add_filter('gettext', 'x_translate_text' , 20, 3);
    function x_translate_text ( $translated_text, $text, $domain ) {
    	$translation = array (
    		'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms & conditions</a>' => 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms & conditions</a>. I agree that I meet the <a href="%s" target="_blank">prerequisites</a> (if any) for this class and understand that class fees are non-refundable.',
    	);
    
    	if( isset( $translation[$text] ) ) {
    		return $translation[$text];
    	}
    	return $translated_text;
    }

    Hope this helps.

    #1285245

    newskywebsites
    Participant

    We can’t catch a break. Now it’s back to just showing the original “I’ve read the terms & conditions.” Screenshot attached of both checkout page and php…

    So close!
    Dawn

    #1285649

    Rad
    Moderator

    Hi there,

    Please change it to this

    add_filter('gettext', 'x_translate_text' , 20, 3);
    function x_translate_text ( $translated_text, $text, $domain ) {
    	$translation = array (
    		'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms & conditions</a>' => 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms & conditions</a>. I agree that I meet the prerequisites (if any) for this class and understand that class fees are non-refundable.',
    	);
    
    	if( isset( $translation[$text] ) ) {
    		return $translation[$text];
    	}
    	return $translated_text;
    }

    Hope this helps.

    #1286286

    newskywebsites
    Participant

    I’m sorry to say that didn’t change the message…