Hi Marti,
Sorry for the late reply.
Thank you.
That’s possible, however, you will need to add a small PHP snippet to your site. If that’s good enough, please add the snippet below to your (child) theme’s functions.php file. Please note that for this filter to be applied, “Date range” option (in “WooCommerce > Settings > Maximum Products per User > General”) must not be set to “Lifetime”.
add_filter( 'alg_wc_mppu_date_to_check', 'my_alg_wc_mppu_date_to_check', 10, 6 );
if ( ! function_exists( 'my_alg_wc_mppu_date_to_check' ) ) {
/**
* Maximum Products per User: Sets "date to check" to current user's membership start date.
*/
function my_alg_wc_mppu_date_to_check( $date_to_check, $date_range, $current_time, $product_or_term_id, $current_user_id, $is_product ) {
foreach ( wc_memberships_get_membership_plans() as $membership_plan_id => $membership_plan ) {
if ( wc_memberships_is_user_active_member( $current_user_id, $membership_plan_id ) ) {
$user_membership = wc_memberships()->get_user_memberships_instance()->get_user_membership( $current_user_id, $membership_plan_id );
$date_to_check = get_post_modified_time( 'U', false, $user_membership->post );
if ( ! $date_to_check ) {
$date_to_check = $user_membership->get_start_date( 'timestamp' ); // Fallback
}
return $date_to_check;
}
}
return $date_to_check;
}
}
Please give it a try and let me know if something is not working as expected, or if you have any questions.
P.S. And if you like the plugin, please consider leaving me a rating.