WordPress filter hook

woocommerce_cart_redirect_after_error

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

“Function for `woocommerce_cart_redirect_after_error` filter-hook.”

How to use woocommerce_cart_redirect_after_error

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_cart_redirect_after_error', function( $permalink, $product_id ) {
	// Change $permalink here.
	return $permalink;
}, 10, 2 );

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

66 plugins that fire woocommerce_cart_redirect_after_error

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

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/class-wc-ajax.php:619
  2. Variation Swatches for WooCommerce icon Variation Swatches for WooCommerce200,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) inc/swatches.php:759
  3. ShopLentor icon ShopLentor80,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) classes/class.ajax_actions.php:99
  4. Depicter icon Depicter70,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) app/src/Modules/WooCommerce/Module.php:62
  5. Jupiter X Core icon Jupiter X Core70,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/extensions/raven/includes/modules/shopping-cart/module.php:121
  6. HT Mega Addons for Elementor icon HT Mega Addons for Elementor60,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/class.single-product-ajax-addto-cart.php:69
  7. Sliding Cart for WooCommerce by FunnelKit icon Sliding Cart for WooCommerce by FunnelKit30,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/ajax.php:149
  8. Product Addons for Woocommerce icon Product Addons for Woocommerce30,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) includes/process/process.php:543
  9. WPC AJAX Add to Cart for WooCommerce icon WPC AJAX Add to Cart for WooCommerce10,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) wpc-ajax-add-to-cart.php:268
  10. Quantity Plus Minus Button for WooCommerce icon Quantity Plus Minus Button for WooCommerce10,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) includes/features/quantiy-archive.php:124
  11. Min Max Control icon Min Max Control10,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) includes/features/quantiy-archive.php:112
  12. ShopBuilder icon ShopBuilder10,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) app/Controllers/Frontend/Ajax/AddToCart.php:67
  13. WPC Frequently Bought Together for WooCommerce icon WPC Frequently Bought Together for WooCommerce10,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/class-woobt.php:652
  14. Variation Swatches for WooCommerce icon Variation Swatches for WooCommerce9,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) app/Controllers/Hooks.php:318
  15. MoreConvert Wishlist for WooCommerce icon MoreConvert Wishlist for WooCommerce8,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', $permalink, $product_id ) includes/class-wlfmc-ajax-handler.php:949
  16. WPC Variation Swatches for WooCommerce icon WPC Variation Swatches for WooCommerce6,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) wpc-variation-swatches.php:221
  17. Boostify Header Footer Builder for Elementor icon Boostify Header Footer Builder for Elementor6,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) inc/elementor/module/class-woocommerce.php:338
  18. Youzify icon Youzify5,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/public/core/woocommerce/class-youzify-wc-activity.php:87
  19. CoDesigner icon CoDesigner4,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', esc_url( get_permalink( $product_id ) ), $product_id ) app/AJAX.php:225
  20. WowStore icon WowStore4,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) addons/variation_swatches/VariationSwatches.php:817
  21. DOOFINDER Search and Discovery for WP & WooCommerce icon DOOFINDER Search and Discovery for WP & WooCommerce2,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/class-add-to-cart.php:161
  22. Modal Fly Cart & AJAX Add to Cart for WooCommerce icon Modal Fly Cart & AJAX Add to Cart for WooCommerce2,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) inc/class-frontend.php:182
  23. WC Builder icon WC Builder1,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/single-add-to-cart-ajax.php:75
  24. WishSuite icon WishSuite1,000+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/classes/Ajax.php:177
  25. Smart Search & Product Filter for WooCommerce icon Smart Search & Product Filter for WooCommerce900+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/widgets/class-search-results.php:304
  26. Unit Price for WooCommerce icon Unit Price for WooCommerce900+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) unit-price-for-woocommerce.php:1174
  27. Instantio icon Instantio700+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/controller/App.php:493
  28. Product Variation Swatches for WooCommerce icon Product Variation Swatches for WooCommerce700+ installs apply_filters( 'woocommerce_cart_redirect_after_error', $url, $product_id ) src/Frontend/Frontend.php:894
  29. Order Bump for WooCommerce icon Order Bump for WooCommerce600+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/hooks/bump/add-to-cart.php:62
  30. Product Table For WooCommerce icon Product Table For WooCommerce500+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) includes/class-awcpt-front-end.php:1061
  31. StoreBuild icon StoreBuild400+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) public/class-pure-wc-shopbuild-public.php:434
  32. Ajaxified Cart icon Ajaxified Cart300+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/class-abwc-ajax-cart-loader.php:147
  33. WPC Save For Later for WooCommerce icon WPC Save For Later for WooCommerce300+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) wpc-save-for-later.php:500
  34. Floating Cart Product For WooCommerce icon Floating Cart Product For WooCommerce300+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) main/frontend/fcpfw_rest.php:185
  35. QuickSwish icon QuickSwish300+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/classes/Ajax.php:110
  36. FoodBook Lite icon FoodBook Lite300+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) inc/class-products.php:467
  37. Iute icon Iute200+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) woocomerce-iutepay-gateway.php:377
  38. Autoship Cloud for WooCommerce Subscription Products icon Autoship Cloud for WooCommerce Subscription Products100+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) src/scheduled-orders.php:2261
  39. Ni WooCommerce Product Variations Table icon Ni WooCommerce Product Variations Table100+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/ni-product-variations-table.php:176
  40. Finest Floating Cart for WooCommerce icon Finest Floating Cart for WooCommerce100+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) includes/functions.php:264
  41. WPC Smart Upsell Funnel for WooCommerce icon WPC Smart Upsell Funnel for WooCommerce100+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) wpc-smart-upsell-funnel.php:871
  42. RestroFood Lite icon RestroFood Lite100+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) inc/class-products.php:471
  43. TPure Variation Swatches for WooCommerce icon TPure Variation Swatches for WooCommerce100+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) public/Frontend.php:234
  44. C4D Product Bundles for WooCommerce icon C4D Product Bundles for WooCommerce60+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/frontend.php:489
  45. Boopis WooCommerce RFQ icon Boopis WooCommerce RFQ50+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/class-boopis-rfq-front.php:313
  46. COMPE icon COMPE20+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) frontend/frontend.php:1804
  47. ThemesZone WooCommerce Ajax Quantity icon ThemesZone WooCommerce Ajax Quantity10+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) public/class-tz-wc-ajax-qty-public.php:132
  48. Express Shop for WooCommerce Product Table icon Express Shop for WooCommerce Product Table10+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) qcld-express-ajax.php:127
  49. Simple Product Bundle icon Simple Product Bundle10+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($ids_bundle[$i]), $ids_bundle[$i] ) includes/bundle-free-functions.php:138
  50. DynamicBlocks icon DynamicBlocks10+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/frontend/class-main.php:460
  51. Variation Monster icon Variation Monster10+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) Inc/Frontend-ajax.php:1579
  52. Advanced Add To Cart for WooCommerce icon Advanced Add To Cart for WooCommerce10+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) advanced-add-to-cart.php:156
  53. Viral Buy for Me for WooCommerce Increase Sales icon Viral Buy for Me for WooCommerce Increase Sales10+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) inc/qcld-cross-sell-ajax.php:230
  54. Formula04 WooCommerce Quick Window icon Formula04 WooCommerce Quick Window10+ installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) formula04_quickwindow.php:904
  55. Et-woo-product-price icon Et-woo-product-priceFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) et-woo-product-price.php:200
  56. Awesome Quick Viewer for WooCommerce Lite icon Awesome Quick Viewer for WooCommerce LiteFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) plugin.php:160
  57. Swift Commerce icon Swift CommerceFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/class-added-to-cart-popup.php:706
  58. StoreMind icon StoreMindFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) storemind.php:699
  59. IPS Cart&Checkout for WooCommerce icon IPS Cart&Checkout for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/classes/Front/Sidecart/SidecartAddToCart.php:93
  60. Advanced Wishlist & Share icon Advanced Wishlist & ShareFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/public/inc/advwl-functions.php:632
  61. Ajax instant buy checkout for WooCommerce icon Ajax instant buy checkout for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) woo-ajax-instant-checkout.php:304
  62. ShopXpert icon ShopXpertFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) incs/features/wishlist/incs/classes/Ajax.php:180
  63. Samply icon SamplyFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/functions.php:163
  64. Single Page Shopping icon Single Page ShoppingFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink($product_id), $product_id ) includes/class-awcs-wc-cart-actions.php:67
  65. Invoice management for Woocommerce icon Invoice management for WoocommerceFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/class-wc-ajax.php:437
  66. Product Table for WooCommerce icon Product Table for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ) includes/ect-add-to-cart.php:51

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.