Add upsell products to offcanvas cart #412
Replies: 3 comments 7 replies
-
Hi Lennart, turned this issue into a discussion because this is no bug or feature. Well, it seems that you made hard change in a sensitive area ;-) So let's try to help.
Cart message fetches the function register_ajax_cart() {
require_once('woocommerce/ajax-cart/ajax-add-to-cart.php');
}
add_action('after_setup_theme', 'register_ajax_cart'); Navigate to and change line to notice = `<div class="woocommerce-message">Your product is succesfully added.</div>`; But Heads up! There will be changes to
You can try to close offcanvas when // Close offcanvas-cart when upsell add-to-cart button is clicked
$( "#offcanvas-cart .ajax_add_to_cart" ).click(function() {
$('#offcanvas-cart').offcanvas('hide');
}); However, cart messages are tricky. I worked nearly half a year on them and they are still not perfect. Combining the messages with upsell products in offcanvas seems to be a very tough job ;-) Last thing, I see that you modified offcanvas by CSS that it looks like a modal. If you modify Hope that helps a bit. |
Beta Was this translation helpful? Give feedback.
-
Wow Basti, thanks a lot! Really appreciate this. Will dive into it tomorrow. I know I went a bit out of the bootscore template.. but needed a really outstanding design. Your last thing is a great one. I didn't thought about that. Will dive in to it. Don't want this to be a mess (also for incoming updates). |
Beta Was this translation helpful? Give feedback.
-
Hi @crftwrk I am working on it. But firstly we want to use the normal offcanvas like it was. But I still have the upsells (products from custom fields) on the cart page. Is it possible to not activate the offcanvas at the cart page? So only hide it on the cart page. |
Beta Was this translation helpful? Give feedback.
-
Hi!
I turned the cart offcanvas into a popup with upsells. It is really great but I have some problems with the message. I turned it into: your product is succesfully added. But with variations I still get the: "product-title" is added to your cart. The second problem is when I am on the cart page and want to add a upsell. Then the message is disappearing after some seconds. The last problem is when I want to add an upsell in the cart popup the message is not showing (the offcanvas needs to reset or opening again or something..).
So my 3 questions are:
Website: https://www.capricci-shop.nl/
Hopefully you're able and willing to help me out.
See images:
Beta Was this translation helpful? Give feedback.
All reactions