使用 AJAX 过滤 WooCommerce 产品
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20105800/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WooCommerce Product Filtering with AJAX
提问by Benjamin
I am trying to understand where the functionality for Woocommerce resides that handles AJAX requests on the Product Archive Pages. So for example when you use the Select Dropdown Form on the Shop page, or when you add a Woocommerce Sidebar Widget like the Layered Nav, or the Product Categories widget. Which WC file either PHP and or Jquery is handling the AJAX request and then returning the Sorted/Filtered data back to the page.
我试图了解 Woocommerce 处理产品存档页面上的 AJAX 请求的功能所在的位置。例如,当您在 Shop 页面上使用 Select Dropdown Form 时,或者当您添加 Woocommerce Sidebar Widget(如分层导航)或 Product Categories 小部件时。PHP 和/或 Jquery 哪个 WC 文件正在处理 AJAX 请求,然后将排序/过滤后的数据返回到页面。
Ultimately what I am trying to do is hook into the default woocommerce AJAX functionality so I can extend it to fade in each product list item <li>separately, or any number of CSS3 effects, like transform 3D. As well as adding a switch button that toggles between Grid and List views for product category pages.
最终我想要做的是连接到默认的 woocommerce AJAX 功能,以便我可以扩展它以分别淡入每个产品列表项<li>,或任意数量的 CSS3 效果,如转换 3D。以及添加一个切换按钮,用于在产品类别页面的网格和列表视图之间切换。
But I just can't find where in the Woocommerce files this is happening.
但我就是无法在 Woocommerce 文件中找到发生这种情况的地方。
Any help is very much appreciated.
很感谢任何形式的帮助。
采纳答案by zdenekca
As far as I know the basic WooCommerce plugin does not provide AJAX ability for Product Archive Pages.
据我所知,基本的 WooCommerce 插件不为产品存档页面提供 AJAX 功能。
If you like to add Ajax filtering and Ajax reload of Product Archive page you can use:
如果您想添加 Ajax 过滤和产品存档页面的 Ajax 重新加载,您可以使用:
a) WooCommerce commercial plugin: http://www.woothemes.com/products/ajax-layered-navigation/
a) WooCommerce 商业插件:http://www.woothemes.com/products/ajax-layered-navigation/
b) Free WordPress plugin called 'YITH WooCommerce Ajax Navigation': http://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
b) 名为“YITH WooCommerce Ajax 导航”的免费 WordPress 插件:http://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
c) WooCommerce AJAX Product Filter plugin: http://codenegar.com/woocommerce-ajax-product-filter/
c) WooCommerce AJAX 产品过滤器插件:http: //codenegar.com/woocommerce-ajax-product-filter/
or something similar.
或类似的东西。
回答by realmag777
WOOF: https://www.woocommerce-filter.com, appeared in 2015 year, AJAX is there as a lot of another tasty features
WOOF: https://www.woocommerce-filter.com,出现在 2015 年,AJAX 是有很多其他好吃的功能

