-
AuthorPosts
-
November 17, 2020 at 4:28 pm #1261048
Hi, I’m using Enfold and FacetWP. Enfold shows the quantity selector of Woocommerce with beautiful Plus and Minus buttons beside the quantity field (see https://weingut-bischof.at/wein-shop/). But if I activate a facet filter, the template changes to the Woocoomerce Up and Down arrows.
The FacetWP support wrote to me:
FacetWP’s refresh works by destroying + rebuilding the result listing. The side effect is that any javascript attached to those listing items (like the JS that generates the +/- buttons) will need to get re-initialized.
Any chance you could reach out to the Enfold team to find out which code is responsible for generating those (+/-) buttons? And if possible, maybe they could also point us to instructions on how to re-initialize it.
I think the buttons are coming from this JS file: https://weingut-bischof.at/wp-content/uploads/dynamic_avia/avia-footer-scripts-25c211e60d33b3cbbb987f5794057608—5fae61549e7ae.js
As you can see, it’s minified and very difficult to read. I tried to prettify it, making it a little more readable: https://d.pr/i/zHtuSv
But long story short, we’ll still need some input from the Enfold team to see how to re-initialize this code on each AJAX refresh (feel free to paste our responses to their team).Can you help?
Thanks, StefanNovember 19, 2020 at 5:34 pm #1261621Anybody here?
Thanks, StefanNovember 21, 2020 at 8:30 pm #1261989Hi,
Sorry for the late reply, as I understand the issue this is just changing the Woocoomerce Up and Down arrow buttons back to the (+/-) buttons, and the functionality is working correctly. Please enable FacetWP so we can investigate further.Best regards,
MikeNovember 22, 2020 at 12:20 pm #1262090Hi Mike,
no, FacetWP filters change the wonderful Enfold +/- buttons back to Woo up/down arrows.You can check this by using a filter on https://weingut-bischof.at/wein-shop/ in the dark grey section above the shop. The question is, how to prevent this (see the comments of FacetWP support).
Thanks and best regards
StefanNovember 22, 2020 at 2:25 pm #1262115Hi,
Thank you for the feedback, I believe the function that the plugin needs to re-initialize isavia_apply_quant_btn
Below you will find a link to the\enfold\config-woocommerce\woocommerce-mod.js
file so the plugin team can see the function on line 32
below the function on line 83 they will see an example of re-initializing the function on ajax update:
$( document ).on( 'updated_cart_totals', avia_apply_quant_btn );
Please share this with the FacetWP team.Best regards,
MikeNovember 23, 2020 at 4:35 pm #1262433Thank you, Mike!
FacetWP has solved the problem:
add_action( ‘wp_head’, function() {
?>
<script>
(function($) {
$(document).on(‘facetwp-loaded’, function() {
$(document).trigger(‘updated_cart_totals’); // fix the “+/-” quantity buttons
});
})(jQuery);
</script>
<?php
}, 100 );Thanks for your support!
StefanNovember 24, 2020 at 1:06 pm #1262639Hi,
Glad to hear this is sorted out, unless there is anything else we can help with on this issue, shall we close this then?Best regards,
MikeNovember 24, 2020 at 1:17 pm #1262645Yes, thank you, Mike
November 24, 2020 at 1:26 pm #1262648Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Conflict with FacetWP’ is closed to new replies.