hello, I am occupying a loop with filters (jetwoo filter) with ajax, when loading the page, the button [yith_compare_button] has no problems, but when clicking on some filter with ajax the button remains as text [yith_compare_button] bone it breaks, any solution?
Hi there,
the problem is that you need to reinit the compare button after a filter was apply. To do that you should ask to filter plugin author if their plugin rigger a js event that we can use to initialize the compare button.
Let us know.
good morning they answered me the following “The trigger is jet-filter-content-rendered, YITH guys can use that 🙂”
Can it be solved with what was sent?
Hi,
please could you provide with the URL the issue occurs in, so we’ll be able to check for that?
https://clientesfreak.cl/demo/naturalbeauty/tienda/
It is a page only for tests so the messy style, but that is the link
Hi there,
the problem is that when the ajax call is performed, our class YITH_Woocompare_Frontend is not loaded. so the shortcode can’t be rendered properly.
Before to include that class we make some check.
public function is_frontend() {
$is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
$context_check = isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'frontend';
$actions_to_check = apply_filters( 'yith_woocompare_actions_to_check_frontend', array( 'woof_draw_products' ) );
$action_check = isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], $actions_to_check );
return (bool) ( ! is_admin() || ( $is_ajax && ( $context_check || $action_check ) ) );
}
You should contact plugin developers and say them to use the hook ‘yith_woocompare_actions_to_check_frontend‘ to include their ajax action to the ones that our plugin check.
We remain at your disposal.
-
This reply was modified 5 years, 4 months ago by
YITHEMES.