400 erron when click add listing button with time zone enabled

Hello HivePress Support,

I am encountering an issue with the time zone setting on my WordPress site, which is using the HivePress template. Here are the details:

  1. I have deactivated all plugins except for HivePress to ensure there are no conflicts.
  2. I went to HivePress > Settings > Bookings and enabled the Time Zone option.
  3. However, when I try to create a listing by clicking the “Add a Listing” button, I get a 400 error from the server, stating that the time zone has not been set, even though it is already set for the user profile.
  4. To bypass this issue, I have to go to the user profile, reselect the time zone, and save it. After doing this, I can successfully create a listing without any errors.
  5. This workaround is inconvenient as I have to manually reset the time zone for the user each time I want to post a new listing.

Could you please assist me in resolving this? I would like to avoid having to update the time zone for each user before creating a new listing.
It’s as if HivePress forgets the user’s time zone.

PS : i use Martinique timezone and i dont have cache

i show you the form data :

  1. latitude:

  2. longitude:

  3. categories:

120

  1. images:

(binary)

  1. title:

test

  1. price:

2

  1. location:

marti

  1. services:

57

  1. opening_hours[66ee19de12161][day]:

tuesday

  1. opening_hours[66ee19de12161][from]:

43200

  1. opening_hours[66ee19de12161][to]:

72000

  1. opening_hours[te4ub8me40b][day]:

wednesday

  1. opening_hours[te4ub8me40b][from]:

43200

  1. opening_hours[te4ub8me40b][to]:

72000

  1. description:

iuttrtrtyufuyg

  1. booking_slot_duration:

30
and server response :

{
    "error": {
        "code": 400,
        "errors": {
            "required": {
                "message": "The 'Booking Time Zone' field is required."
            }
        }
    }
}

Hi,

Most likely, you have enabled the Manage availability per vendor feature in HivePress > Settings > Bookings, and if so, you need to fill in the time zone in the vendor settings first, then everything will work correctly. Also, make sure you have the latest version of Bookings 1.5.2.

​I hope this is helpful to you.

as explained, I’ve already set the time zone in the vendor settings. ( 3)
The problem is as follows:

If I create a new vendor on my site and immediately post a listing, the site asks me to configure the seller and requires me to select a time zone. Then, the site asks me to configure the listing, and everything works fine (for the first listing).

Now, if I log out and log back in with the same vendor and try to post a second listing (I go directly to the listing configuration page), I get a 400 error saying that the time zone is missing. When I check the vendor’s configuration, the time zone is correctly added, but I still have to click “save settings” again for the time zone to be considered, allowing me to post the listing.
i can give you an access to my website and wordpress admin. Or give you a video wich show the problem.
my bookings version is : 1.5.2

Hi,

Yes, if you have the possibility, please send us a video of this issue, as we cannot reproduce it locally.

i trying to send you the video with a youtube link

You can see the video at this private link : https://youtu.be/rlqRFGGepT4

Hi,

Please send temporary WP access to support@hivepress.io with details for reproducing this issue, and we’ll check it (please send only the link, without login and password). You can create a temporary access link using this plugin Temporary Login Without Password – WordPress plugin | WordPress.org.

I’ve sent you the email

Hi,

Thank you for the link. We have passed the information to the developer, and we need a little more time to check it out. Please make sure that the link you sent us is valid for at least 7 days.

Thanks for the detailed bug report, this issue occurs only with the combination of settings of per-vendor mode, time slots and time limitation to specific categories. Please use this code snippet as a temporary fix, we’ll also fix it in the next update so you don’t have to do anything after adding the snippet (you can add it to the child theme’s functions.php file or via the Code Snippets plugin):

add_action(
	'hivepress/v1/models/listing/create',
	function( $listing_id, $listing ) {
		$vendor = $listing->get_vendor();

		if ( $vendor ) {
			update_post_meta( $listing_id, 'hp_booking_timezone', $vendor->get_booking_timezone() );
		}
	},
	1000,
	2
);