New Landing How can we help? Themeforest Theme Support Dante Add 'continue shopping' (or similar) button to the add to cart message

Viewing 15 posts - 1 through 15 (of 15 total)
  • Posted in: Dante
  • #118952
    crease
    Member
    Post count: 101

    Can I add a ‘continue shopping’ (or similar) button to the add to cart message, similar to the view car button already existing in the message. I know this is woocommerce section but wondered if you could point in the right direction so I could ad it myself as I cant find anything else to help. Thanks

    Screenshot attached to help with visual.

    Attachments:
    You must be logged in to view attached files.
    #119103
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You need to use this plugin http://docs.woothemes.com/document/woocommerce-cart-notices/ to customize the message.
    Thanks
    Mohammad

    #119135
    crease
    Member
    Post count: 101

    Looks like I can still only add one button though. I want review cart and continue shopping! May I will have to add the button somewhere else.

    #119136
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please out this code at functions.php of child theme.

    add_filter( 'woocommerce_add_to_cart_message', 'woocommrece_custom_add_to_cart_message' );
    
    function woocommrece_custom_add_to_cart_message() {
    
    global $woocommerce;
    
     
    
    // Output success messages
    
    if (get_option('woocommerce_cart_redirect_after_add')=='yes') :
    
     
    
    $return_to = get_permalink(woocommerce_get_page_id('shop'));// Give the url, you want to redirect
    
     
    
    $message = sprintf('<a href="%s">%s</a> %s', $return_to, __('Continue Shopping &rarr;', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') );
    
     
    
    else :
    
     
    
    $message = sprintf('<a href="%s">%s</a> %s', get_permalink(woocommerce_get_page_id('cart')), __('View Cart &rarr;', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') );
    
     
    
    endif;
    
     
    
    return $message;
    
    }

    Thanks
    Mohammad

    #119140
    crease
    Member
    Post count: 101

    Parse error: syntax error, unexpected ‘add_filter’ (T_STRING) in /home/langleyd/public_html/wp-content/themes/dante-child/functions.php on line 223

    Sorry it didnt work. Thanks for trying though.

    #119142
    crease
    Member
    Post count: 101

    line 223 is the first line of your code.

    #119160
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Can you provide admin access so we can check the error?
    Thanks.

    -Rui

    #119218
    crease
    Member
    Post count: 101
    This reply has been marked as private.
    #119220
    crease
    Member
    Post count: 101

    I have blanked the code in the functions file as it was breaking the site but it is still there.

    #119221
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Now the code doesn’t trow any error, you had a character 2 lines before that was causing that.
    -Rui

    #119231
    crease
    Member
    Post count: 101

    The site works now but it hasn’t given me a solution that works… the message still remains the same.
    See screenshot attached.

    Attachments:
    You must be logged in to view attached files.
    #119239
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Just fixed the error that was displaying. Will forward to Mohammad that provided the code.
    Remember that this is something already outside the scope of our support.

    -Rui

    #119240
    crease
    Member
    Post count: 101

    I know and I appreciate what you are doing. Just wanted to say it didn’t work. Thanks for all your help.

    #119241
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    No problem. Let’s wait for Mohammad reply.
    -Rui

    #119243
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please contact at woocommerce support about this custom change.
    Thanks
    Mohammad

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register