Holiday mode option for vendors to hide all listings

Hey,

I know this isn’t currently built-in to HivePress, but I’d like to suggest it as a feature, and, if possible have some guidance on how to try and implement this on my own in the meantime.

On a vendor’s front-end Account > Settings page, I’d like to add an option which can be enabled/disabled (a checkbox or toggle) that when activated will set all of that user’s listings to the Hidden status.

Similarly, by deactivating the option, all of the vendor’s listings would be Visible again.

My use-case and the thinking behind this is that if a vendor has one or more listings that they would like to temporarily hide whilst they’re on holiday, sick or not accepting bookings, etc. they could simply use this new option to hide/show all of their existing listings without having to go in and adjust the visibility settings for each listing.

I hope that makes sense!

Note: The holiday mode setting should also respect membership/subscription status, so that vendors cannot abuse the option to mark listings visible without an active membership/subscription.

Cheers,
Chris :victory_hand:

Hi,

Thanks for your suggestion, we’ll consider adding this feature.

1 Like

Hey,

As usual, I couldn’t help but try and implement this on my own, and I think I’ve got a stable version made up for my own use-case anyway.

  • It adds a new checkbox option under Account > Settings for vendors.
  • Succesfully drafts and undrafts all of a users listings when the checkbox is enabled/disabled.
  • Shows a reminder to the user on all /account/* pages that holiday mode is enabled.
  • Always shows for Admin accounts for testing purposes
  • Checks if a user has an active WooCommerce Subscription to prevent publishing listings without an active Membership.

If anyone wants to try this out, you can download the .zip here and install it as a regular plugin.

You can also view the code here if you’re interested.

Cheers,
Chris :victory_hand:

2 Likes

Thanks for sharing this! This will be very helpful for our community.

1 Like