• Resolved galatanuadrian27

    (@galatanuadrian27)


    Hi!

    Awesome plugin!

    Can you please tell me how can we change “View Cart” text?

    Its not working from public/js/enhanced-ajax-add-to-cart-wc-public.js:134

    ??

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author The Rite Sites

    (@theritesites)

    Hi Galatanu!

    At this point in time, we do not offer a way to change the “view cart” text — this function is actually being brought in from a WooCommerce JavaScript package wc-add-to-cart. This is where the text is coming from in public/js/enhanced-ajax-add-to-cart-wc-public.js:134

    Also, when you make changes to this file, this will not affect a live website without debug mode (either site wide, or plugin specific debugging) as there is a minified javascript file bundled with the plugin at public/js/enhanced-ajax-add-to-cart-c-public.min.js
    This file must be re-built if the original non-minified javascript file is edited.

    At this point, there are two paths forward:
    1) You can make changes to the non-minified javascript file and load the non-minified javascript in all environments by modifying the asset enqueuing at public/class-enhanced-ajax-add-to-cart-wc-public.php:78-81 and comment out these lines. This will have line 82 be the only default line and will load the non-minified file, and will let you change the javascript file. With this, you will have to make this change with every update to this plugin.

    2) Alternatively, you can use CSS in a kind of hack-y way to do what you would like:
    // Below hides the original text.
    .added_to_cart.wc-forward {
    font-size: 0;
    }
    // Below adds the string “checkout!” on the button in size 13 font, change as needed
    .added_to_cart.wc-forward::after {
    content: “checkout!”;
    font-size: 13px;
    }

    Lastly, we will add a solution to our backlog on this plugin that will let a user change all the shortcode buttons text via an options page, but in the plugins current state, we cannot have different “view cart” text per shortcode.

    Please let me know if there is anything else that I can help you with!

    Best regards,
    Parker Mathewson

    The Rite Sites

Viewing 1 replies (of 1 total)
  • The topic ‘Change “View Cart” Text’ is closed to new replies.