Home Forums Plugins WooCommerce Boost Sales change cart text to basket

change cart text to basket

  • Author
    Posts
  • #51346

    Howard Massey
    Participant

    https://www.dropbox.com/s/khdhliwb91v860c/Screenshot 2020-02-12 13.17.38.png?dl=0

    https://www.dropbox.com/s/eomcd8go3rr590m/Screenshot 2020-02-12 13.17.32.png?dl=0

    Hi,

    We need to change all references of cart to say basket as we are in the uk, if I do this with a normal text replacement method it makes the ajax button not work and makes the whole page reload instead of just quickly bringing up the upsell pop up.

    I have tried:

    function woo_custom_change_cart_string($translated_text, $text, $domain) {

    $translated_text = str_replace(“cart”, “basket”, $translated_text);
    $translated_text = str_replace(“Cart”, “Basket”, $translated_text);
    $translated_text = str_replace(“View Cart”, “View Basket”, $translated_text);

    return $translated_text;
    }

    add_filter(‘gettext’, ‘woo_custom_change_cart_string’, 100, 3);
    add_filter(‘ngettext’, ‘woo_custom_change_cart_string’, 100, 3);

    But that code just makes the error as described above.

You must be logged in to see replies to this topic. Click here to login or register