This commit is contained in:
Prospress Inc
2018-12-12 14:48:11 +01:00
committed by Remco Tolsma
parent 37367ac369
commit 721dda6e5c
340 changed files with 5114 additions and 2125 deletions

18
includes/wcs-cart-functions.php Executable file → Normal file
View File

@@ -382,3 +382,21 @@ function wcs_get_cart_item_name( $cart_item, $include = array() ) {
return $cart_item_name;
}
/**
* Allows protected products to be renewed.
*
* @since 2.4.0
*/
function wcs_allow_protected_products_to_renew() {
remove_filter( 'woocommerce_add_to_cart_validation', 'wc_protected_product_add_to_cart' );
}
/**
* Restores protected products from being added to the cart.
* @see wcs_allow_protected_products_to_renew
* @since 2.4.0
*/
function wcs_disallow_protected_product_add_to_cart_validation() {
add_filter( 'woocommerce_add_to_cart_validation', 'wc_protected_product_add_to_cart', 10, 2 );
}