Home › Forums › Basel support forum › Add Subscription to cart is not triggering the Mini Cart Sidebar
Add Subscription to cart is not triggering the Mini Cart Sidebar
- This topic has 13 replies, 2 voices, and was last updated 7 years ago by Artem Temos.
-
AuthorPosts
-
November 4, 2017 at 4:34 pm #23240
dabodudeParticipantHello!
We have a simple subscription product using the official WooCommerce Subscription Plugin but when clicking on add to cart button, this particular product is not triggering the mini cart sidebar widget… Can you help?
https://goo.gl/ck3K81November 4, 2017 at 7:18 pm #23249
Artem TemosKeymasterHello,
We are glad to know that you considered using Basel for your web-site. I hope you will be happy with it.
Could you please provide us your FTP and admin access so we can check if this issue related to our theme? In case it because of Basel, we will try to fix it on your website.
Kind Regards
XtemosNovember 5, 2017 at 8:58 am #23277
dabodudeParticipantYes, find the details in the private content
November 5, 2017 at 9:04 pm #23286
Artem TemosKeymasterWe also need your server authorization data https://gyazo.com/50703f84e95972e76890c6c9299de146
November 5, 2017 at 9:41 pm #23292
dabodudeParticipantWoops, sorry about that. Forgot I had it. Find the details in private content.
November 6, 2017 at 7:14 am #23304
Artem TemosKeymasterHi,
We have disabled AJAX add to cart on the single product page and now it works. Unfortunately, it doesn’t work with this plugin and it redirects customers to check out right after adding the product to cart.
Regards
November 7, 2017 at 10:47 pm #23465
dabodudeParticipantHello Artem, well I think that works but I really liked the theme on how it works with the AJAX add to cart and triggers the sidebar mini cart.
So I asked the plugin developers to take a look at it and this is what they told me:
—–
Thanks for contacting Prospress support and report your problem!At first glance, it really seems like a compatibility issue with BASEL theme and WooCommerce Subscriptions. If this is the case, the theme development team should be the one that handles this problem, as they’re the ones that are customizing the default behavior of WooCommerce. Unless they say that it is related to a problem or bug in WooCommerce Subscriptions code, we won’t be able to help you much longer (as this kind of customizations is out of our support scope).
Can you please contact them again and check if they can add the proper patch to support WooCommerce Subscriptions plugin?
If not, I’d suggest you to ask them how exactly are they dealing with add to cart process to see if there’s any possible workaround we can apply on your side to make it work as expected.
—-So, what do yo think? Can you fix it or tell me how are you dealing with the add to cart process?
Thanks for your help!
November 8, 2017 at 7:12 am #23478
Artem TemosKeymasterHello,
Actually, there is no bug not in our theme nor in the plugin. But yes, we rewrite default WooCommerce behavior because it doesn’t have AJAX add to cart on the single product page by default. And it is obvious that some plugins like that add some additional fields to the add to cart form that our AJAX handler is not aware of. So the handler for adding to cart in our theme is located in the file
js/functions.js
. Function name –addToCartAllTypes
. If they want to add their custom data to the process, they will need to disable JS minification in Theme Settings -> Performance.Regards
November 13, 2017 at 10:45 am #23966
dabodudeParticipantThanks Artem,
I sent them what you proposed and attached the JS file but I couldn’t get them to help me.
Do you think you could create a function snippet where I can avoid the AJAX add to cart functionality only for certain post ids and then sent people to cart instead of checkout?
This is the response I got from the plugin devs:
Hi David,
Thanks for the update. Unfortunately, this doesn’t seem to be a case where there is an easy work-around. It looks like there is just an incompatibility with your theme and the non-mixed checkout functionality in Subscriptions. That happens sometimes; we can’t guarantee that Subscriptions will be compatible with every theme. If you would like to use both Basel and Subscriptions, you could add a customization to your site to fix the issue. Per WooCommerce’s support policy, we do not customize our product or provide support for customizations, but you could certainly hire a third party developer such as a WooExpert to do a customization for you.
Let us know if you have any further questions!
Austin
November 13, 2017 at 12:49 pm #23986
Artem TemosKeymasterHi,
You can disable this function only globally for all products. Add this code snippet to the funcitons.php file in the child theme
add_action( 'basel_ajax_add_to_cart', '__return_false' );
Regards
December 8, 2017 at 1:45 pm #27918
dabodudeParticipantWill it be possible to add this snippet with a conditional argument? For instance, disable ajax add to cart only on post id “xxx”?
December 8, 2017 at 3:05 pm #27925
Artem TemosKeymasterYou can use this code and specify your product IDs
function basel_disable_ajax_on(){ $disable_ajax_on = array( 22, 55, 815 ); foreach ( $disable_ajax_on as $value ) { if ( is_product() && $value == get_the_ID() ) { add_action( 'basel_ajax_add_to_cart', '__return_false' ); } } } add_action( 'wp', 'basel_disable_ajax_on' );
December 8, 2017 at 4:12 pm #27930
dabodudeParticipantAwesome! Thanks a lot!
December 8, 2017 at 6:02 pm #27940
Artem TemosKeymasterYou are welcome!
-
AuthorPosts
The topic ‘Add Subscription to cart is not triggering the Mini Cart Sidebar’ is closed to new replies.
- You must be logged in to create new topics. Login / Register