WP actions don’t work in fragments after adding to cart
-
WP actions don’t work in fragments after adding to cart
I’ve added some custom cart fragments. In those fragments I use WP filters, localization functions etc.
When I add product to cart I get those fragments and dysplay it on page on “added_to_cart” event.
Everything is going well. But after woocs_refresh_mini_cart function calls wragments refresh and those fragments come without WP filtersHere is an exampme
1 – My own fragments – https://prntscr.com/ifnpev You can see that there are no delete buttons and quantity field, this is my WP filters
2 – After this your plugin send requerst to wp-admin/admin-ajax.php and invokes woocs_refresh_mini_cart JS function and my WP filters are crashed – https://prntscr.com/ifnru4
Also you can see that language was changet to English from RussianMy solution
If I change request URL in woocs_refresh_mini_cart function from wc_cart_fragments_params.ajax_url with param action: ‘woocommerce_get_refreshed_fragments’ to wc_cart_fragments_params.wc_ajax_url.toString().replace(‘%%endpoint%%’, ‘get_refreshed_fragments’) everything works well.If it’s your mistace, can you fix it in nearest update. Thanks.
- The topic ‘WP actions don’t work in fragments after adding to cart’ is closed to new replies.