Hi Mohsen,
Sorry for the delay,
First, you could setup the default date range that would work for most of your categories, let’s say monthly. And then you could enable Limits > Per product category and edit the limit on the category page.
Finally, you’d have to use a custom code for the other category with different date range. I’ve created it for you as an example considering the id of the category A as 41
add_filter( 'alg_wc_mppu_date_to_check', function ( $date_to_check, $date_range, $current_time, $product_or_term_id, $current_user_id, $is_product ) {
if ( ! $is_product ) {
return $date_to_check;
}
$product_categories_ids = wp_get_post_terms( $product_or_term_id, 'product_cat', array( 'fields' => 'ids' ) );
// Yearly for category A (41)
if ( in_array( 41, $product_categories_ids ) ) {
$date_to_check = ( $current_time - YEAR_IN_SECONDS );
}
return $date_to_check;
}, 10, 6 );
Let me know if it helps 😉