• Resolved gferguson78

    (@gferguson78)


    Hi there,

    We use this plugin to provide ApplePay payments at the checkout stage only. We don’t use it for credit card, PayPal or anything else – these options have all been disabled. I notice however that the plugin still adds a lot of hidden input fields to the add-to-cart button on all product pages. Is there any way to completely remove these fields? They are not added on the shop archive pages and the add-to-cart button works fine there so I don’t think these are necessary on product pages.

    The hidden input fields generated all start with ‘wc_braintree_xx’ – for instance – ‘wc_braintree_cart_currency’. Because we have a floating add-to-cart button on our product pages as well these fields are generated twice with the same IDs, causing Google Chrome to generate warning about every field having a non-unique ID.

    We are unable to use the ApplePay Buy Now button on our product pages as our page cache prevents the button from working correctly.

    Many thanks,
    Gordon

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

    (@mrclayton)

    Hi @gferguson78,

    You can prevent the fields from being output to your product page with the following snippet of code. Add it to your child theme’s functions.php or wherever you add custom development for your site.

    remove_action('woocommerce_after_add_to_cart_button', 'WC_Braintree_Field_Manager::output_product_checkout_fields');
    remove_action('woocommerce_before_add_to_cart_button', 'WC_Braintree_Field_Manager::output_product_checkout_fields')

    In the next release, I will make it so the fields only output if there are gateway’s enabled on the product page.

    Kind Regards,

    Thread Starter gferguson78

    (@gferguson78)

    Many thanks. I tried that code in our functions.php file but the fields are still being generated on product pages. I’ll wait on the next update though if that will solve the issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hidden fields added to product page’ is closed to new replies.