woocommerce / bookings-helper

This extension is a WooCommerce Bookings helper which helps you to troubleshoot bookings setup easier by allowing you to quickly export/import product settings.
32 stars 6 forks source link

Added ability to clean up wc_booking_relationships #4

Closed jessepearson closed 7 years ago

jessepearson commented 7 years ago

This bug in Bookings 1.10 beta created additional entries in the *_wc_booking_relationships table. This PR adds the ability to clean up those extra entries.

It queries all products that has_resources, goes through each and queries their resources. It then builds a new array of resources for each of those products and enters them into the database. Once they are entered, it removes all of the previous resources.

I had it add all of the resources first and then remove all priors due to it is better to have additional entries then to lose all entries.