Forum Replies Created
-
AuthorPosts
-
November 9, 2021 at 7:18 am in reply to: Can I set a different date range for different products? #100771
onlinestore_admin
ParticipantApologies for the duplicate post, the browser was adding a new post instead of replying here…
Another question, since I’m running a multisite and each site has a different requirement or product restrictions, I am using a code snippet plugin instead of adding it in the functions.php file.
I am getting an error with the <pre></pre>tag. Is this required to be in the code or can I just remove it? I tried the code without this and it seems to be working fine. Thanks againNovember 7, 2021 at 11:33 pm in reply to: Can I set a different date range for different products? #100769onlinestore_admin
ParticipantHi! I haven’t tested this but some more questions..
In your example:
switch ( (int) $product_or_term_id ) { case 1: // Product A - Lifetime. $date_to_check = 0; break; case 2: // Product B - Last 7 days. $date_to_check = ( $current_time - WEEK_IN_SECONDS ); break; case 3: // Product C - Last 24 hours. $date_to_check = ( $current_time - DAY_IN_SECONDS ); break; }– How do I place the product ID instead of the product name? Example Product ID#123
– What about multiple product ID’s? example: id#123, id#234, id#345
– What is the code to check for 15days and 30days?
Thank you!
-
AuthorPosts