• Resolved bhranch

    (@bhranch)


    Is there a way on product pages after you add a item to your cart it then show at the top of the page your item has been added to your cart then button at the side says View Cart.
    Here is the screen cap: https://cloud.degoo.com/share/icWMlkAByXyWCeqT9jOSog

    How can I change the View Cart button ? I would like it to say Continue Shopping and then the link would be back to my shop page.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Sunday Ukafia (a11n)

    (@sukafia)

    Hi @bhranch,

    We have documentation on translating WooCommerce text strings here: https://docs.woocommerce.com/document/woocommerce-localization/#section-5

    Additionally, I see there’s a code snippet that’ll work for your use case here

    I hope that helps!

    Thread Starter bhranch

    (@bhranch)

    Hello Sunday,
    Thank You for the information, but unfortunately it didn’t work. I have code snippet plugin and put it in there. I tried this code two different ways like the stackoverflow article shows, but it never changed anything. One without the add_filter( ‘woocommerce_get_script_data’, ‘change_view_cart_link’,10,2 ); then one with it. The button on my website still says View Cart & the link is the cart page after I add a product.

    This one first:

    function change_view_cart_link( $params, $handle )
    {
        add_filter( 'woocommerce_get_script_data', 'change_view_cart_link',10,2 );
        switch ($handle) {
            case 'wc-add-to-cart':
                $params['i18n_view_cart'] = "Continue Shopping"; //change Name of view cart button
                $params['cart_url'] = "https://www.mywebsite.com/store/"; //change URL of view cart button
            break;
        }
        return $params;
    }

    __________________________________
    Then This one with added hook like article showed:

    function change_view_cart_link( $params, $handle )
    {
        switch ($handle) {
            case 'wc-add-to-cart':
                $params['i18n_view_cart'] = "Continue Shopping"; //change Name of view cart button
                $params['cart_url'] = "https://www.mywebsite.com/store/"; //change URL of view cart button
            break;
        }
        return $params;
    }

    What can I do to get the button to change from View Cart to Continue Shopping and the link go back to my store page ?

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    If you do require more help with the actual coding, we’d recommend you hire a developer who can take a look at this, quote you for their services and help you add this feature to your site. We’d recommend getting in touch with a web developer or one of the customisation experts listed at https://woocommerce.com/customizations/.

    Cheers.

    Thread Starter bhranch

    (@bhranch)

    Hello Gabriel,
    Thank You for you information, I really appreciate it. I have been working on trying to get the button, Praying and the Good Lord helped me get what I needed just now. I did some css coding and got a view & continue button. Here is a screen cap: https://cloud.degoo.com/share/rMVqiikJ-VGlo8eCQA7JjQ

    Thanks again & I will keep your information in mind to check out in case I ever need any other help. Have a Blessed rest of the week.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Glad to know that you could figure it out! 🙂

    Great! If you have any further questions, you can start a new thread.

    Have a great day ahead.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Product Pages View Cart Button Change’ is closed to new replies.