Join our new community forum for support & discussion

Join Now

Home Support Themes ListingHive The user deletes a listing but still has 0 free listings left

The user deletes a listing but still has 0 free listings left

  • Author
    Posts
  • nineleafclover

    I want that when a user deletes a listing his listing count also decreases by 1. So that if his limit is exceeded he can just delete a listing and upload a new one.

    yevhen developer

    Sorry, there is no such option in Paid Listings at the moment, this would require custom implementation. It does not count listings available simultaneously, it decreases the purchased listing limit by 1 on any listing submission or renewal.

    nineleafclover

    Could you just guide me a little about the custom implementation so for eg the function that runs on submission and renewal. I would like that function to run whenever the listing is deleted. I just need to know where that function is located. Could you show me the light in terms of files I need to work on to achieve this.

    yevhen developer

    Sure, you can try using the hivepress/v1/models/listing/update_status hook https://hivepress.github.io/hook-reference/hivepress_v1_models_%257Bmodel_name%257D_update_status.html You can check if the status is changed from publish or back, and increase/reduce the listing limit. Please check the listing limit implementation here https://github.com/hivepress/hivepress-paid-listings/blob/master/includes/components/class-listing-package.php#L31
    Hope this helps.

Viewing 4 posts - 1 through 4 (of 4 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.