• Resolved katmacau

    (@katmacau)


    Hello. I would like to add a second button after the view cart button that appears after you add a product to the cart on a single product page. This is the non-ajax add to cart message that appears at the top of the page. So the output would look like this:

    <div class="woocommerce-message" role="alert">
    <a href="https://mydomain.com.au/cart/" tabindex="1" class="button wc-forward">View cart</a> 
    <a href="https://mydomain.com.au/shop/" class="button wc-forward">Continue Shopping</a> 
    “Black Dress” has been added to your cart.	
    </div>

    I have tried string translate but that does not allow HTML. I have looked into different hooks but cannot find the one that applies on to the view cart message in the top message strip.

    • This topic was modified 5 years, 5 months ago by katmacau.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi!

    While we can’t officially advise on customisation, there are a number of community suggestions for code snippets that you can add to your functions.php file that are findable via web search, that add a Continue Shopping flash to the cart – one example that works is here.

    The best way to add this code would be using the Code Snippets plugin so that any changes won’t be overwritten when you update your theme.

    Thread Starter katmacau

    (@katmacau)

    Are you able to advise on what the hook is to tap into with an add_action call to tap into the “woocommerce-message”. I have found many ways to insert a continue shopping link but none that I have found will do it inside the message div that appears after submitted an add to cart on single product page.

    I can’t advise specifically on a custom implementation, but here’s the official code reference which should help you on the right track here for your code solution.

    For the benefit of anyone reading this looking for a plugin solution, of if you decide to go the plugin route, we have Dynamic Cart and Checkout Notices extension in the WooCommerce marketplace, which fits the bill nicely and gives you lots of flexibility about the types of messages you can display and the conditions to display them.

    I’ll leave the thread open for a little while in case any developers can shed any light on your customisation question. 🙂

    Just to add, I noticed we also have Cart Notices which is even more specific for those wanting to display a call to action at the cart stage.

    Plugin Support Tseten a11n

    (@tibetanitech)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Add continue shopping button after view cart button’ is closed to new replies.