• Resolved reynskie

    (@reynskie)


    hi there is there a code to add it to the function.php to reset the limit of the user if the user purchase a product? im using paid membership pro.

    e.g
    if user 1 purchase product 1 then it limits a user to publish only 5 posts.
    when user used all the 5 posts then purchase back the product 1. can it be the limitation reset back to 5 again ?

    thanks for the response

Viewing 5 replies - 16 through 20 (of 20 total)
  • Plugin Author Condless

    (@condless)

    Update the cycle of the users to few days ago, than for the date to be updated to the day before the order instead of the day of the order when purchased the product, replace the line:
    update_user_meta( $user_id, 'cycle', $order->get_date_created()->date( 'Y-m-d' ) );
    With:
    update_user_meta( $user_id, 'cycle', date( 'Y-m-d', strtotime( $order->get_date_created()->date( 'Y-m-d' ) . ' - 1 day' ) ) );

    Thread Starter reynskie

    (@reynskie)

    hi condless

    thanks for the response i really appreciated it.

    btw the code you provided is not working. it won’t update the cycle date.

    Plugin Author Condless

    (@condless)

    Hi, the code should work, can you try to modify the user’s cycle into 2020-08-09 manually and than purchase the product?

    Thread Starter reynskie

    (@reynskie)

    hi

    i set the cycle to 2020-08-09
    then i created a post, the limitation is working correctly. https://prnt.sc/uxzjxz
    when i try to purchased it change the date. but not the limitation still 2/2 https://prnt.sc/uxzmwc

    i try to used the original code from documents.
    the cycle date was changed and the limit is change to 0/2, however when i submitted a post its not updating, still 0/2 after submitted a post. https://prnt.sc/uxzpcm

    • This reply was modified 4 years, 5 months ago by reynskie.
    Plugin Author Condless

    (@condless)

    Hi,
    As described via Email, the code in the docs was updated so the reset will happen only by the end of the day of the purchase. The purpose is to prevent the incorrect posts calculation.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘reset limit’ is closed to new replies.