• Hello!

    After looking throughly throughout all the posts I can find and trying all of them out I’m struggling to get what I wanted to do done.

    Basically: When you add a product to the cart a message appears at the top of the screen as confirmations. What I would like to do is customise this message and add the specific variation SKU in that message, is this possible?

    If so any help would be greatly appreciated!

    Kind regards and thanks in advance.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    You mean you want to show more than the product title itself?

    Thread Starter bb05091995

    (@bb05091995)

    Hello Mike!
    Hope you had a good weekend,

    yeah so currently it shows:

    Click here for IMGUR link

    if this is at all possible that would be amazing.. I’ve tried a lot of things I’ve seen online and nothing has worked so far ??

    Kind regards,
    Ben.

    Plugin Contributor Claudio Sanches

    (@claudiosanches)

    You can filter it using wc_add_to_cart_message, this filter controls how is displayed that message.

    Thread Starter bb05091995

    (@bb05091995)

    I place this into the snippets, I assume I filtered it all correctly,

    add_filter( 'wc_add_to_cart_message', 'custom_add_to_cart_message' );
    
    function custom_add_to_cart_message() {
    
    global $woocommerce;
    $return_to  = get_permalink(woocommerce_get_page_id('shop'));
    $message    = sprintf('<a href="%s" class="button wc-forwards">%s</a> %s', $return_to, __('Continue Shopping', 'woocommerce'), __('TESTESTEST.', 'woocommerce') );
    return $message;
    }

    If its me beings stupid I’m sorry!

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Looks fine.

    Thread Starter bb05091995

    (@bb05091995)

    Ah yes that did work, I forgot to enable the snippet! my bad, So thats awesome and working, in terms of returning the SKU, I know how to do it for simple products, how about variation products? is that a possibility?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Should be the same.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Added to cart Notification Customisation’ is closed to new replies.