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

committed by
Remco Tolsma

parent
5fb62b0e6a
commit
1039aec2d9
@@ -24,7 +24,13 @@ function wcs_get_product_limitation( $product ) {
|
||||
$product = wc_get_product( $product );
|
||||
}
|
||||
|
||||
return apply_filters( 'woocommerce_subscriptions_product_limitation', WC_Subscriptions_Product::get_meta_data( $product, 'subscription_limit', 'no', 'use_default_value' ), $product );
|
||||
if ( $product->is_type( 'variation' ) ) {
|
||||
$parent_product = wc_get_product( $product->get_parent_id() );
|
||||
} else {
|
||||
$parent_product = $product;
|
||||
}
|
||||
|
||||
return apply_filters( 'woocommerce_subscriptions_product_limitation', WC_Subscriptions_Product::get_meta_data( $parent_product, 'subscription_limit', 'no', 'use_default_value' ), $product );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user