diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index 1304a67043d..a548126c09d 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -1851,7 +1851,7 @@ class WC_Cart { foreach ( $this->coupons as $code => $coupon ) { if ( $coupon->is_valid() && ( $coupon->is_valid_for_product( $product, $values ) || $coupon->is_valid_for_cart() ) ) { - $discount_amount = $coupon->get_discount_amount( ( 'yes' === get_option( 'woocommerce_calc_discounts_sequentially', 'no' ) ? $price : $undiscounted_price ), $values, true ); + $discount_amount = $coupon->get_discount_amount( 'yes' === get_option( 'woocommerce_calc_discounts_sequentially', 'no' ) ? $price : $undiscounted_price, $values, true ); $discount_amount = min( $price, $discount_amount ); $price = max( $price - $discount_amount, 0 ); @@ -1873,6 +1873,11 @@ class WC_Cart { $this->increase_coupon_applied_count( $code, $values['quantity'] ); } } + + // If the price is 0, we can stop going through coupons because there is nothing more to discount for this product. + if ( 0 >= $price ) { + break; + } } } diff --git a/includes/class-wc-post-types.php b/includes/class-wc-post-types.php index 0c492fcb18b..ae990f74c22 100644 --- a/includes/class-wc-post-types.php +++ b/includes/class-wc-post-types.php @@ -147,6 +147,7 @@ class WC_Post_types { 'new_item_name' => __( 'New Shipping Class Name', 'woocommerce' ) ), 'show_ui' => true, + 'show_in_quick_edit' => false, 'show_in_nav_menus' => false, 'query_var' => is_admin(), 'capabilities' => array( @@ -184,16 +185,17 @@ class WC_Post_types { 'add_new_item' => sprintf( __( 'Add New %s', 'woocommerce' ), $label ), 'new_item_name' => sprintf( __( 'New %s', 'woocommerce' ), $label ) ), - 'show_ui' => true, - 'show_in_menu' => false, - 'show_in_nav_menus' => false, - 'meta_box_cb' => false, - 'query_var' => 1 === $tax->attribute_public, - 'rewrite' => false, - 'sort' => false, - 'public' => 1 === $tax->attribute_public, - 'show_in_nav_menus' => 1 === $tax->attribute_public && apply_filters( 'woocommerce_attribute_show_in_nav_menus', false, $name ), - 'capabilities' => array( + 'show_ui' => true, + 'show_in_quick_edit' => false, + 'show_in_menu' => false, + 'show_in_nav_menus' => false, + 'meta_box_cb' => false, + 'query_var' => 1 === $tax->attribute_public, + 'rewrite' => false, + 'sort' => false, + 'public' => 1 === $tax->attribute_public, + 'show_in_nav_menus' => 1 === $tax->attribute_public && apply_filters( 'woocommerce_attribute_show_in_nav_menus', false, $name ), + 'capabilities' => array( 'manage_terms' => 'manage_product_terms', 'edit_terms' => 'edit_product_terms', 'delete_terms' => 'delete_product_terms', diff --git a/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php b/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php index 996c96eeb7c..8f1c18db81e 100644 --- a/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php +++ b/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php @@ -62,7 +62,6 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway { // Hooks add_action( 'wp_enqueue_scripts', array( $this, 'payment_scripts' ) ); - add_action( 'admin_notices', array( $this, 'checks' ) ); add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); add_action( 'woocommerce_receipt_' . $this->id, array( $this, 'receipt_page' ) ); add_action( 'woocommerce_api_wc_gateway_simplify_commerce', array( $this, 'return_handler' ) ); @@ -101,6 +100,8 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {

+ checks(); ?> + generate_settings_html(); ?>