-
AuthorPosts
-
August 18, 2020 at 10:21 pm #1238933
Hey :)
First, I really love your theme.
and the support forum and the team, you guys are awesome!
you all really help me adjust every website to its owner and every client has different requests. you really help me make completely different sits every time.
thanks a lot!I want to change 2 things in the woocommerce cart page, and I need your help.
1. I want to change the text in the coupon table.
I used this cod-lines:
function custom_script(){
?>
<script>
(function($){
$(document).ready(function(){
$(“#top.woocommerce-cart .coupon input#coupon_code”).attr(“placeholder”, “הכנס קוד קופון”);
$(‘#top.woocommerce-cart button.button[name=”apply_coupon”]’).text(‘קופון מיוחד לחברי הפרלה’מנט’);
});
})(jQuery);
</script>
<?php
}
add_action(‘wp_footer’, ‘custom_script’);and for some reason, the 2 Hebrew sentences inside the apostrophe appears as – ????? ????? ???? ?????????? (because the site is active, I deleted the code-lines I added)
the site’s main language is Hebrew.2. same website, same cart page, after you remove a product from the cart, you get a woocommerce message. at the end of that message there’s a question – cancel? (and as you know it’s linked) I want to change that to ‘return back to cart?’
how do I do that?
and, I need the text to appear in Hebrew at the front end (at the moment everything is in Hebrew)thank you so mutch!
August 27, 2020 at 8:57 am #1241128Hey MPPcreative,
Thank you for the inquiry.
1.) It might be that the font that you’re using doesn’t support Hebrew characters. You may need to switch to another font and make sure that it supports the required characters.
2.) You can add this filter in the functions.php file to change the default link of the button.
/** * Changes the redirect URL for the Return To Shop button in the cart. * * @return string */ function wc_empty_cart_redirect_url() { return 'http://mywebsite.com/sample-page/'; } add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' );
Best regards,
IsmaelAugust 27, 2020 at 10:20 am #1241157hey Ismael,
thank you for replying.1. I’m using ‘Heebo’ font, from the theme itself, and this font definitely supports Hebrew characters.
2. That is not what I meant, I want to change the text from ‘cancel’ to ‘return the product back to cart’ where can I edit that?thank you :)
August 28, 2020 at 5:00 pm #1241646Hi,
Thank you for the update.
1.) Instead of using the previous script, try to use the following filter to adjust the text of the coupon code field.
// https://www.grahamethomson.com/2018/10/07/rename-coupon-code-text-in-woocommerce/
You may need to adjust this line:
if ( 'Coupon code' === $text ) { $translated_text = 'Offer Code'; }
2.) You can try this filter in the functions.php file to change the cancel or undo link.
add_filter('gettext', 'avf_cart_undo_translation', 35, 3 ); function avf_cart_undo_translation( $translation, $text, $domain ) { if( $text === 'Undo?' ) { $translation = __( 'Undo', $domain ); } return $translation; }
Add the translation here:
$translation = __( 'Undo', $domain );
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.