Listings remain hidden (expired) after user renews

Hello,

I’ve create a website using Hivepress for freelance professionals to advertise their availability to recruiters. I have set this up so that listings expire 30 days after the date the freelancer says they are available from (to ensure the availability dates are kept up-to-date).

I have just realised that the listings are not correctly re-publishing when a user goes to renew an expired listing. If they click the link in the expiry email, they are correctly taken to their listing where they can update the ‘Available From’ date and click the button to re-publish, however their listing is still not visible to recruiters, and they need to go back into the listing through their profile to “unhide” this.

Please can you urgently look into this? I can see there are now over 200 listings which appear to have expired, and I believe a large number of these users believe their listing is live again as there is no indication that it’s still hidden.

Thanks,
Matt

Hi,

If you mean that listing renewal skips the select package page (if you use Paid Listings), we are aware of this bug, and we will fix it in the next updates. But if everything works correctly with the select package page, but the listing is not published after payment, then please provide more details regarding this issue (e.g., your actions step by step with screenshots, etc.). This will help us to reproduce and resolve the issue faster.

Hi, thanks for your quick reply.

I am not using Paid Listings, so there is no select package page. The listings should just renew without any payment.

After doing some testing, I believe the issue is ocurring due to me setting a 0 date offset for my Available From attribute. If I remove the date offset, the listings renew correctly. If I have the date offset set to 0, the user needs to amend the Available From date to today’s date, click Renew Listing, but they are then taken to the home page (no renew message) and their listing is still hidden. It seems to me that, as they have had to amend their Available Date, the ‘Renew Listing’ button is now only acting as a ‘Save Changes’ action, and therefore the listing remains expired after clicking Renew?

I need to have the Available date offset set to 0 to avoid users renewing their listing with an old (older than 30 days) Available From date, as this will bypass their listing ever expiring again. My website depends on recruiters having confidence that the listings (especially the freelancer availability) is current.

Thanks,
Matt

Hi again, actually the issue seems to occur if the user makes any change to their Available From date, regardless if I have set a Date Offset or not.

So to repeat - if the user only clicks on Renew Listing without amending their Available From date, the listing renews correctly. If they amend their Available From date and click Renew, they’re taken back to the home page and the listing is still in Hidden status.

Hi,

Please provide more details, is Available From date a custom attribute or a built-in attribute from the Bookings extension?

Hi, this is a custom attribute. If you would like to take a look at the site, it’s productionfreelancers.com (it’s free to add of view listings)

FYI I’m using experthive theme

Thanks

Hi,

Please provide a screenshot of the settings of this attribute, we will check in more detail.

Here you go:



I also have a code snippet which sets the listing to expire 30 days after the Available date:

Hi,

I see. This is an issue with your PHP snippet. Please note that your snippet is fired on every form submission, not when available_from changes, because the hook you’re using doesn’t fire on changes but generally on any storage, so renew can’t overwrite expiration. So I recommend adding a check that some value has changed, etc.

Hi there, thanks for that. I’m only slightly familiar with this coding - I just copied and pasted it from another post on this forum from another user who was trying to do the same thing with listings expiry.

Please could you help me to modify the snippet so that it doesn’t interrupt the renewal process?

Thanks,
Matt

This is the post I took the PHP snippet from:

I’m sorry for the inconvenience, this would require further customizations. If you’re familiar with coding basics, you can try to use another API hook (for the expiration date change) to remove the first hook and prevent it from firing.

Hi Ihor,

Is it not possible just to add something onto the end of that PHP snippet to set the listing to visible once the expiry date has been set? I’m just struggling to understand which other hook I could use, when I need the expiry to be updated when the availablefrom field is changed.

Thanks,
Matt

Yes, you can try this code instead of the last line of the function:

$listing->fill([
    'expired_time' => strtotime($value.' + 30day'),
    'status' => 'publish',
])->save(['expired_time', 'status']);

But I can’t say for sure that it will not cause other issues, this requires further testing. We can provide general guidance for customizations, but unfortunately customizations of the built-in functionality are not within our support scope.

Hope this helps.

Hi Ihor,

Thanks for sending over that suggestion. Unfortunately, it doesn’t appear to have worked, as the listings remain hidden after renewing - unless I’ve made a mistake amending the snippet?

image

Thanks again,
Matt

Hi,

Sorry, but unfortunately, we can only provide general recommendations, but not customize the functionality, if you are familiar with coding, you can view sample snippets at this link Search · user:hivepress first name · GitHub. If not, I recommend hiring someone on Fiverr or Upwork.

No worries, I understand. I’ll try to figure it out.

Thanks

Ah, I found my error and this is now working. Thanks for your help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.