• Resolved sirchunk

    (@sirchunk)


    Hi,

    On the cart page, I have added an extra section within the cart_totals div using the woocommerce_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 using wp_enqueue_script() and loading jquery styling via wp_register_style() and wp_enqueue_style().
    Settings for the datepicker is being added to the footer of the cart via wp_footer hook and doing a is_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.

    https://wordpress.org/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thread Starter sirchunk

    (@sirchunk)

    Managed to sort it by using jQuery(document).ajaxComplete(function() to reload the functions I need.

Viewing 1 replies (of 1 total)
  • The topic ‘JQuery Datepicker stops working when Woocommerce cart does a partial refresh’ is closed to new replies.