Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter philippwolf

    (@philippwolf)

    Hi Clayton,

    Thanks for your help. I have one more question.
    With Germanized, I can remove unnecessary Mini-Cart output cleanly using its specific action hook, for example:

    add_action(‘init’, function() {
    remove_action(
    ‘woocommerce_widget_shopping_cart_before_buttons’,
    ‘woocommerce_gzd_template_mini_cart_taxes’,
    10
    );
    }, 100);

    This prevents the Germanized Mini-Cart data from being generated/rendered in the first place.
    Is there a similar official/recommended action hook in Payment Plugins for Stripe WooCommerce that I can remove on non-Checkout pages to prevent wc_stripe_data from being generated in the first place?
    I tried the AssetDataController::enqueue_asset_data remove_action() approach you suggested, but wc_stripe_data is still present in the get_refreshed_fragments AJAX response.
    I only use the standard Stripe Credit/Debit Card gateway and have no Express Checkout or Stripe payment methods in the Mini-Cart.
    If there is a specific hook for this, could you please provide the recommended code?
    Thanks!


    • This reply was modified 1 week, 1 day ago by philippwolf.
    • This reply was modified 1 week, 1 day ago by philippwolf.
    • This reply was modified 1 week, 1 day ago by philippwolf.
    Thread Starter philippwolf

    (@philippwolf)

    Hi, thanks for the detailed explanation.

    Just to clarify my setup, I’m currently using version 4.0.10, with only the standard Stripe Credit/Debit Card gateway enabled. I do not have any payment methods enabled for the mini-cart, and there is no option in the mini-cart to pay by card or initiate a payment.

    I’m also using Germanized for WooCommerce and Astra theme.

    Despite this, wc_stripe_data is still being included in the WooCommerce cart fragments AJAX response whenever there is at least one product in the cart. Since the mini-cart is present in the header on every page, this means the Stripe data is being returned through the fragments request on essentially every page.

    I also see the same wc_stripe_data being included in the fragments response when a product is added to the cart via AJAX.

    In my case, I would like to completely remove this Stripe data from the cart fragments responses on non-Checkout pages. The standard Stripe Credit/Debit Card gateway is only needed on the Checkout page, so I would like to avoid generating and transferring this data through cart fragments on product pages and other pages where Stripe payment is not available.

    Could you please provide the correct/recommended function code to completely prevent wc_stripe_data from being added to the cart fragments response outside the Checkout page?

    I saw your example using remove_action() with AssetDataController::enqueue_asset_data, but I would appreciate the exact recommended code for this use case, especially considering that I’m also using Germanized for WooCommerce.

    I want to make sure the solution removes the data completely from the fragments response without affecting the Stripe Credit/Debit Card gateway on the actual Checkout page.

    Thanks!

    Thread Starter philippwolf

    (@philippwolf)

    is there no solution for this?

    Thank you for any help.

Viewing 3 replies - 1 through 3 (of 3 total)