woocommerce_cart_is_elegible_for_service_sale

Hook Filter

Filter if cart is eligible for service sale.

Description

This filter allows modifying the cart eligibility for selling services. This could be useful in some cases when it's not possible to determine if every item in the WooCommerce's cart represent a service. For example, when the products were created used a plugin that define custom product types or doesn't use the standard WC_Product class.

ParameterTypeDescription
$is_eligibleboolActual eligibility state

Changelog

VersionDescription
2.0.0Introduced

Usage Example

add_filter('woocommerce_cart_is_elegible_for_service_sale', function($is_eligible){
  $is_eligible = ... // Modify the default value
  return $is_eligible;
});