Changeset 2671583
- Timestamp:
- 02/02/2022 06:48:48 PM (4 years ago)
- Location:
- disable-cart-page-for-woocommerce/trunk
- Files:
-
- 2 edited
-
disable-cart-page-for-woocommerce.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
disable-cart-page-for-woocommerce/trunk/disable-cart-page-for-woocommerce.php
r2574129 r2671583 7 7 Author: Code4Life 8 8 Author URI: https://code4life.it/ 9 Version: 1.2. 49 Version: 1.2.5 10 10 Text Domain: disable-cart-page-for-woocommerce 11 11 Domain Path: /i18n/ … … 14 14 15 15 WC requires at least: 2.0 16 WC tested up to: 5.516 WC tested up to: 6.1 17 17 */ 18 18 … … 106 106 107 107 // Force WooCommerce to redirect after product added to cart 108 update_option( 'woocommerce_cart_redirect_after_add', 'yes' ); 108 add_filter( 'pre_option_woocommerce_cart_redirect_after_add', function( $pre_option ) { 109 return 'yes'; 110 } ); 111 109 112 add_filter( 'woocommerce_product_settings', function( $fields ) { 110 113 foreach ( $fields as $key => $field ) { … … 119 122 120 123 // Empty cart when product is added to cart, so we can't have multiple products in cart 121 add_action( 'woocommerce_add_cart_item_data', function( ) {124 add_action( 'woocommerce_add_cart_item_data', function( $cart_item_data ) { 122 125 wc_empty_cart(); 126 return $cart_item_data; 123 127 } ); 124 128 -
disable-cart-page-for-woocommerce/trunk/readme.txt
r2574129 r2671583 4 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donazione&item_number=Contributo+libero¤cy_code=EUR&lc=it_IT 5 5 Requires at least: 4.6 6 Tested up to: 5. 87 Stable tag: 1.2. 46 Tested up to: 5.9 7 Stable tag: 1.2.5 8 8 WC requires at least: 2.0 9 WC tested up to: 5.59 WC tested up to: 6.1 10 10 License: GPLv3 11 11 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 53 53 For more information, see [Official page](https://code4life.it/shop/plugins/disable-cart-page-for-woocommerce/). 54 54 55 = v1.2.5 = 56 * Added "pre_option_woocommerce_cart_redirect_after_add" hook to force WooCommerce to redirect after product added to cart 57 * Bug fix: added return $cart_item_data variable in "woocommerce_add_cart_item_data" hook 58 55 59 = v1.2.4 = 56 60 * Added function to empty cart if error occurs
Note: See TracChangeset
for help on using the changeset viewer.