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

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #23240

    dabodude
    Participant

    Hello!

    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/ck3K81

    #23249

    Artem Temos
    Keymaster

    Hello,

    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
    Xtemos

    #23277

    dabodude
    Participant

    Yes, find the details in the private content

    #23286

    Artem Temos
    Keymaster

    We also need your server authorization data https://gyazo.com/50703f84e95972e76890c6c9299de146

    #23292

    dabodude
    Participant

    Woops, sorry about that. Forgot I had it. Find the details in private content.

    #23304

    Artem Temos
    Keymaster

    Hi,

    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

    #23465

    dabodude
    Participant

    Hello 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!

    #23478

    Artem Temos
    Keymaster

    Hello,

    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

    #23966

    dabodude
    Participant

    Thanks 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

    #23986

    Artem Temos
    Keymaster

    Hi,

    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

    #27918

    dabodude
    Participant

    Will it be possible to add this snippet with a conditional argument? For instance, disable ajax add to cart only on post id “xxx”?

    #27925

    Artem Temos
    Keymaster

    You 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' );
    #27930

    dabodude
    Participant

    Awesome! Thanks a lot!

    #27940

    Artem Temos
    Keymaster

    You are welcome!

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

The topic ‘Add Subscription to cart is not triggering the Mini Cart Sidebar’ is closed to new replies.