JQuery Datepicker stops working when Woocommerce cart does a partial refresh
-
Hi,
On the cart page, I have added an extra section within the
cart_totals
div using thewoocommerce_after_cart_totals
hook.
This new section is displayed depending on the cart contents.The problem I am having is this new section contains a jquery datepicker and works fine when the page loads, but when the item quantities are altered and the ‘update cart’ button is pressed, the cart does a partial reload via AJAX and loses the datepicker functionality.
I’m loading the pre-registered
jquery-ui-datepicker
usingwp_enqueue_script()
and loading jquery styling viawp_register_style()
andwp_enqueue_style()
.
Settings for the datepicker is being added to the footer of the cart viawp_footer
hook and doing ais_cart()
check.
(The reason I’m doing this rather than using enqueue is because the javascript settings changes via PHP depending on certain Woocommerce session data).I’m guessing that some how I need to reload the jquery scripts and settings when the partial reload is done?
If so, can anyone point me in the right direction on how to do this please?Thanks in advance.
- The topic ‘JQuery Datepicker stops working when Woocommerce cart does a partial refresh’ is closed to new replies.