• Resolved sackerly

    (@sackerly)


    We seem to have a conflict between the Woocommerce for Braintree plugin and the Elementor page builder, specifically the accordion and popup functions of Elementor. I have disabled ALL plugins except for Elementor, Elementor Pro, Woocommerce, and Woocommerce for Braintree, and Woocommerce for Braintree seems to trigger the problem. The accordion (Subscription FAQs) and the popups (in the main menu) no longer work. We are using Astra theme, but I switched themes to Twenty Twenty with no effect.

    Can you help with this? We are eager to use this plugin!

    Thank you

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @sackerly,

    Thank you for contacting us. I believe I know what the problem is. I reviewed the page you linked and can see you are displaying products on this page.

    I can see there are some JS errors like the following:

    Uncaught ReferenceError: wc_braintree_global_params is not defined

    That tells me that the Braintree plugin scripts are being output but their required JS vars are not because the Braintree plugin doesn’t recognize that page as being one of the following:

    – checkout page
    – cart page
    – product page
    – add payment method page

    There is a filter provided by the plugin where you can force it to localize the vars. Please add the following code to your theme’s functions.php

    add_filter('wc_braintree_print_scripts', function($bool){
        return true;
    });

    Once you add that let me know and I can review your page again.

    I see you have Apple Pay enabled for product pages and that’s why the scripts are loading but this isn’t a product page. Can you explain how you’re using elementor on this page?

    Kind Regards,

    Thread Starter sackerly

    (@sackerly)

    Thank you for the reply. Yes, you are correct, that this is not a checkout, cart, product, or payment page.

    I added the code that you provided as a snippet, using the Code Snippet plugin, and got the error:

    The code snippet you are trying to save produced a fatal error on line 1:
    syntax error, unexpected ‘&’

    https://drive.google.com/file/d/1q2FRCaTZ0Z8ftaOpPTI_2fK261UpUWdZ/view?usp=drivesdk

    Did I enter this code incorrectly?

    Thank you ??

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @sackerly,

    For some reason the code snippet didn’t copy over. The ' are supposed to be quotations. Let’s try this again.

    add_filter(‘wc_braintree_print_scripts’, function($bool){
    return true;
    });

    Kind Regards,

    Thread Starter sackerly

    (@sackerly)

    Oh thank you. That codes works like a charm. Thank you so much!

    On this webpage, subscriptions are only purchased one at a time, and not in conjunction with any other products, so that when a product is selected on the store page, the user is taken directly to the cart. We are using Elementor for page layout, and some various snippets to reconfigure how the products appear on the page.

    I think you solved the problem. Thank you again!

    Plugin Author Payment Plugins

    (@mrclayton)

    @sackerly,

    Cool thanks for confirming that snippet resolved the conflict. If you have a moment I always appreciate a good review:

    https://www.ads-software.com/support/plugin/woo-payment-gateway/reviews/

    Kind Regards,

    Thread Starter sackerly

    (@sackerly)

    Hi there, I don’t know why this fix seemed to be working yesterday, but today it is not. Could you check this again for errors? Do you see the script that I added

    https://stagingfully.wpengine.com/join

    Thank you!

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @sackerly,

    Did you update your theme which could have erased the snippet of code I gave you?

    It’s recommended that custom code be added to a child theme so it’s upgrade safe.

    Kind Regards,

    Thread Starter sackerly

    (@sackerly)

    Thank you for the reply. Unfortunately no, I added the code into the child theme functions.php file. I think yesterday I may have been mistaken that it worked, perhaps because the Braintree plugin somehow deactivated (which also fixes the issue).

    Any other thoughts? Thank you.

    Plugin Author Payment Plugins

    (@mrclayton)

    @sackerly

    Can you please contact me via the Help button located on the settings pages of the Braintree plugin?

    Kind Regards,

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Conflict with Elementor Accordion and Popups’ is closed to new replies.