WordPress action hook

woocommerce_set_cart_cookies

Defined by WooCommerce and fired by 29 plugins in total, running on 7.1M+ sites between them.

“Force initializing Woo session”

How to use woocommerce_set_cart_cookies

It's an action: your callback runs at that point and receives 1 argument. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'woocommerce_set_cart_cookies', function( $set ) {
	// Your code runs here.
}, 10, 1 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

29 plugins that fire woocommerce_set_cart_cookies

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs do_action( 'woocommerce_set_cart_cookies', $set ) includes/class-wc-cart-session.php:594
  2. Germanized for WooCommerce icon Germanized for WooCommerce70,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/class-wc-gzd-customer-helper.php:350
  3. Price Based on Country for WooCommerce icon Price Based on Country for WooCommerce20,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/class-wcpbc-frontend.php:330
  4. WCFM Membership icon WCFM Membership10,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) core/class-wcfmvm-ajax.php:157
  5. Revopic icon Revopic10,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) frontend/frontend.php:1146
  6. B2BKing icon B2BKing10,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) public/class-b2bking-public.php:679
  7. YITH Request a Quote for WooCommerce icon YITH Request a Quote for WooCommerce10,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/class.yith-request-quote.php:122
  8. CatalogX Product Catalog, Product Enquiry & Quotes for WooCommerce icon CatalogX Product Catalog, Product Enquiry & Quotes for WooCommerce5,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) classes/Core/QuoteCart.php:57
  9. YITH WooCommerce Waitlist icon YITH WooCommerce Waitlist2,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/class.yith-wcwtl-frontend.php:485
  10. MKL Product Configurator for WooCommerce icon MKL Product Configurator for WooCommerce2,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) inc/compatibility/yith-quote-request.php:252
  11. Tilopay icon Tilopay2,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/InitTilopay.php:45
  12. Visma Pay for Woocommerce icon Visma Pay for Woocommerce1,000+ installs do_action( 'woocommerce_set_cart_cookies', true ) visma-pay-payment-gateway.php:1027
  13. MarketKing icon MarketKing700+ installs do_action( 'woocommerce_set_cart_cookies', true ) public/class-marketking-core-public.php:1096
  14. Autify Digital Lloyds® Gateway for WooCommerce icon Autify Digital Lloyds® Gateway for WooCommerce100+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/class-autify-lloyds-cardnet-checkout-solution.php:224
  15. Gemini Enterprise for CX icon Gemini Enterprise for CX100+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/REST/Cart_Session.php:346
  16. Visma Pay (Embedded Card) for Woocommerce icon Visma Pay (Embedded Card) for Woocommerce100+ installs do_action( 'woocommerce_set_cart_cookies', true ) visma-pay-embedded-card-payment-gateway.php:836
  17. Vindi Hub icon Vindi Hub60+ installs do_action( 'woocommerce_set_cart_cookies', true ) src/VindiWoocommerce.php:153
  18. DigiPay Payment Gateway icon DigiPay Payment Gateway50+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/fullpayment/digipay-fullpayment-gateway.php:60
  19. Boopis WooCommerce RFQ icon Boopis WooCommerce RFQ50+ installs do_action( 'woocommerce_set_cart_cookies', $set ) includes/class-boopis-rfq-session.php:526
  20. Kount Fraud Prevention icon Kount Fraud Prevention30+ installs do_action( 'woocommerce_set_cart_cookies', true ) services/kfpwoo-account-creation.php:95
  21. Mobile App for WooCommerce: ShopApper Mobile App Builder Service for WooCommerce icon Mobile App for WooCommerce: ShopApper Mobile App Builder Service for WooCommerce30+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/MyCred.php:672
  22. Cleever icon Cleever20+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/moona_amplitude.php:31
  23. FCF-Pay icon FCF-Pay10+ installs do_action( 'woocommerce_set_cart_cookies', true ) core/includes/classes/class-fcf-pay-gateway.php:84
  24. Floating Buttons for WooCommerce icon Floating Buttons for WooCommerce10+ installs do_action( 'woocommerce_set_cart_cookies', TRUE ) functions.php:765
  25. PWACommerce icon PWACommerce10+ installs do_action( 'woocommerce_set_cart_cookies', true ) includes/class-pwacommerce-api.php:249
  26. Dialog eZ Cash payment gateway for Woocommerce icon Dialog eZ Cash payment gateway for Woocommerce10+ installs do_action( 'woocommerce_set_cart_cookies', true ) woocommerce-ezcash.php:70
  27. MyUser Payments icon MyUser Payments10+ installs do_action( 'woocommerce_set_cart_cookies', true ) index.php:263
  28. Inference Works icon Inference WorksFewer than 10 installs do_action( 'woocommerce_set_cart_cookies', true ) includes/Bundle.php:9
  29. IPS Waitlist for WooCommerce icon IPS Waitlist for WooCommerceFewer than 10 installs do_action( 'woocommerce_set_cart_cookies', true ) includes/classes/Modules/Waitlist/front/IPSCMI_ORDER_WAITLIST_MODULE_Frontend.php:890

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.