Home › Forums › WoodMart support forum › Custom add to cart message
Custom add to cart message
- This topic has 8 replies, 2 voices, and was last updated 6 years, 2 months ago by
Elise Noromit.
-
AuthorPosts
-
December 9, 2018 at 5:50 pm #94980
annachiParticipantHello
I added the below code at woodmart -> functions.php but not working. Any idea ?
/**
* Custom Add To Cart Messages
* Add this to your theme functions.php file
**/
add_filter( ‘wc_add_to_cart_message’, ‘custom_add_to_cart_message’ );
function 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’));
$message = sprintf(‘%s %s’, $return_to, __(‘Continue Shopping →’, ‘woocommerce’), __(‘Product successfully added to your cart.’, ‘woocommerce’) );
else :
$message = sprintf(‘%s %s’, get_permalink(woocommerce_get_page_id(‘cart’)), __(‘View Cart →’, ‘woocommerce’), __(‘Product successfully added to your cart.’, ‘woocommerce’) );
endif;
return $message;
}
/* Custom Add To Cart Messages */Thanks
December 9, 2018 at 5:59 pm #94981
annachiParticipantHere my website access.
December 9, 2018 at 6:39 pm #94985
annachiParticipantI want cart added message like on attached picture. Kindly help me.
Attachments:
You must be logged in to view attached files.December 9, 2018 at 9:03 pm #94995
Elise NoromitMemberHello,
If you want just to change the wording, remove the code you have added. You can rewrite all theme and plugin texts via PO file in WordPress. Here is a video tutorial that should help you translate your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3
Best Regards
December 9, 2018 at 10:10 pm #95003
annachiParticipantThanks for your reply.
I don t want to translate, on my shop, the “succesfully added cart” message doesn t appear at all.
Please check my website and try to add from Shop page, no any notifications.I enabled themes -> shop -> No action.
I don t want open cart on sidebar but just showing a message that product has been added.NB: I removed the code of my previous message.
Thanks
December 10, 2018 at 7:37 am #95046
Elise NoromitMemberHello,
If you want just message you need to choose “Show popup” http://prntscr.com/lsxv4y
Best Regards
December 10, 2018 at 8:02 am #95056
annachiParticipantYes something like that but without disturbing client navigation, the popup disturb each time when we add on product. How we can make it secretly a pop up from bottom ? And just inform that product is added not display every time on middle of the screen.
Kindly help me… 😉
Thanks
December 10, 2018 at 8:04 am #95058
annachiParticipantMoreover we need to click on continu shopping to add another product, we don t want that behaviour. If client add 50 products, need to click “continu shopping ” ? It s not user friendly navigation.
I hope you understand what i want.
December 10, 2018 at 9:32 am #95080
Elise NoromitMemberHello,
There is no option to show in the bottom. You have an icon in the header and each time a buyer adds the product he will see it on the icon.
In order to keep shopping after adding a product to cart, navigate to Woodmart > Settings and disable redirecting to the cart after product adding.
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register