woocommerce / woocommerce-accommodation-bookings

An accommodations add-on for the WooCommerce Bookings extension.
87 stars 31 forks source link

Help Finding Product Type Selector #430

Closed faisal-alvi closed 2 days ago

faisal-alvi commented 1 month ago

All Submissions:


Changes proposed in this Pull Request:

After a thorough debugging and investigation, it is found that the search for the selector for the product type was incorrectly coded (or maybe the HTML changed in recent WP/Woo releases). This PR tweaks the code so that the selector is found and the proper class is applied to the dates, making them display as fully booked when required, ultimately fixing the reported issue (#417).

Note: in the reported issue it is mentioned that it occurs only when the "Display visitor's local time" setting is enabled but it was occurring regardless of this setting.

Closes #417.

Steps to test the changes in this Pull Request:

  1. Create an accommodation product for day booking.
  2. Set "Number of rooms available" to 1 in availability settings.
  3. Book a room for a day, for example, the 25th of the month.
  4. After successful booking placement, return to the calendar and note that the 25th should appear as booked, not available to select as start date.

Changelog entry

Fix - Unavailable accommodation days appear available even when booked.

faisal-alvi commented 1 month ago

@dkotter I checked and found the following e2e test code that covers checking the existence of the unavailable start day. The E2E test is expected to fail but it requires an investigation. The original issue is that we do not see the unavailable day, rather we see a green/available day; the following test code checks for it.

https://github.com/woocommerce/woocommerce-accommodation-bookings/blob/ad98ad681a8197d202327af7a1d6080952cd1b15/tests/e2e/specs/product.spec.js#L194-L198

image

ankitguptaindia commented 1 month ago

@faisal-alvi I am checking this issue with the trunk branch and it works as expected with trunk. Can you check once if you still able to reproduce with trunk?

https://github.com/woocommerce/woocommerce-accommodation-bookings/assets/6384299/378fcf25-58ad-4d49-8b00-16bbe100114c

faisal-alvi commented 1 month ago

I tested again in trunk and I can reproduce the issue. The following are the plugin versions/settings in use.

Please make sure you re-build the project when you move to the trunk branch from this PR branch. If it still does not work, let's plan a 1:1 connection.

ankitguptaindia commented 1 month ago

@faisal-alvi I checked again with the older Woo version 8.8.3 as mentioned above and also tried without using fixes of this PR#3755 as having time zone-related fixes but I am still not able to reproduce it. Let's have a 1:1 when you have time. I will try on your setup.

ankitguptaindia commented 3 weeks ago

Issue background:

This issue was reported approximately 3 months ago, and recent testing showed it was not reproducible. we tried on various environments, but it was hard to reproduce.

After in-depth debugging, it was found that this issue is only reproducible with the TT4 theme and works fine with the Storefront theme, although at the time of reporting, the issue was also happening with the Storefront theme.

Please have a look at the screencast below to know more (with trunk/stable branch):

https://github.com/woocommerce/woocommerce-accommodation-bookings/assets/6384299/18f81be8-2d75-4307-a81a-722bde70f74a

The below QA report shows that the current PR fixes the issue for TT4 as well.

ankitguptaindia commented 3 weeks ago

QA/Test Report- βœ…

Testing Environment -

* WordPress: 6.5.4 * Theme: Storefront Version: 4.6.0 / Twenty Twenty-Four Version: 1.1 * WooCommerce - Version 9.0 * PHP: 8.3 * Web Server: Nginx * Browser: Chrome - Version 126 * OS: macOS Sonoma 14.4.1 * Git Branch: `fix/417`

Test Results - Issue has been fixed and working fine with Storefront as well as Twenty Twenty Four theme.

Functional Demo / Screencast -

After Fix:

https://github.com/woocommerce/woocommerce-accommodation-bookings/assets/6384299/9ced3391-959d-4513-ac93-e16d5b4f5b95

Before Fix:

https://github.com/woocommerce/woocommerce-accommodation-bookings/assets/6384299/18f81be8-2d75-4307-a81a-722bde70f74a

Next Step- Ready for UAT.

ankitguptaindia commented 2 weeks ago

Regression+Smoke Test Report- βœ…

Testing Environment -

* WordPress: 6.5.5 * Theme: Storefront Version: 4.6.0 / Twenty Twenty Four: Version: 1.1 * WooCommerce - Version 9.0.2 * PHP: 8.3.0 * Web Server: Nginx * Browser: Chrome - Version 126 * OS: macOS Sonoma V 14.4.1

Tested with Archive File created via

php woorelease.phar build https://github.com/woocommerce/woocommerce-accommodation-bookings/tree/smoke-testing

Please note that this plugin has been tested with the build created by the specified versions ☝🏼 of Composer, Node, and NPM.

Status- Working as expected. Ready to merge πŸš€

cc: @vikrampm1