Tagged: x
-
AuthorPosts
-
December 6, 2016 at 4:02 pm #1283728
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!
DawnDecember 6, 2016 at 4:03 pm #1283729** Latest version of everything except WP 4.6.1
December 7, 2016 at 12:17 am #1284119Hi 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!
December 7, 2016 at 7:47 am #1284558I 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!!
DawnDecember 7, 2016 at 9:09 am #1284677Hi 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’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 🙂
December 7, 2016 at 9:21 am #1284689Oh 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!
DawnDecember 7, 2016 at 9:22 am #1284692This reply has been marked as private.December 7, 2016 at 10:35 am #1284765Hi 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’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!
December 7, 2016 at 10:45 am #1284778Wow! 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!!
DawnDecember 7, 2016 at 11:47 am #1284866Hi 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 🙂
December 7, 2016 at 11:58 am #1284880Thanks 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!!
DawnDecember 7, 2016 at 4:27 pm #1285186Hello 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’ve read and accept the <a href="%s" target="_blank">terms & conditions</a>' => 'I’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.
December 7, 2016 at 5:03 pm #1285245We 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!
DawnDecember 7, 2016 at 11:28 pm #1285649Hi 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’ve read and accept the <a href="%s" target="_blank">terms & conditions</a>' => 'I’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.
December 8, 2016 at 11:08 am #1286286I’m sorry to say that didn’t change the message…
-
AuthorPosts