mirror of
https://github.com/pronamic/woocommerce-subscriptions.git
synced 2025-10-16 14:22:56 +00:00
2.4.5
This commit is contained in:

committed by
Remco Tolsma

parent
37367ac369
commit
721dda6e5c
18
includes/wcs-cart-functions.php
Executable file → Normal file
18
includes/wcs-cart-functions.php
Executable file → Normal 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 );
|
||||
}
|
||||
|
Reference in New Issue
Block a user