• Hi. I am trying to change the text as below:

    Original string: Sorry, your session has expired. Return to shop
    Text domain: woocommerce
    Text context:
    Replacement string: There were courses in your cart that were previously taken.

    Here is the line of code I am working from:

    if ( WC()->cart->is_empty() ) {
    				throw new Exception( sprintf( __( 'Sorry, your session has expired. <a href="%s" class="wc-backward">Return to shop</a>', 'woocommerce' ), esc_url( wc_get_page_permalink( 'shop' ) ) ) );
    			}

    What am I doing wrong?

Viewing 1 replies (of 1 total)
  • Plugin Author Lee Willis

    (@leewillis77)

    Hi;

    From what you’ve posted (and it’s difficult to be 100% based on what the forums might be doing to things), it looks like you’re on the right track.

    There are a couple of things to look out for:

    – You might have a custom function, or other plugin interfering with replacements (do other replacements work?)
    – Check that nothing has got changed by your editor when copy/pasting from the code, e.g. smart quotes, tabs vs spaces etc.
    – That might not be the actual string that’s being used (From memory that is only used in a non-Javascript case – I think there’s an equivalent produced via AJAX which might be made up slightly differently)

    Hope those point you in the right direction.

Viewing 1 replies (of 1 total)
  • The topic ‘Unable to change the text. What am I doing wrong?’ is closed to new replies.