在Woocommerce中隐藏“缺货"产品 [英] Hide 'out of stock' products in Woocommerce

查看:244
本文介绍了在Woocommerce中隐藏“缺货"产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在产品"和库存"下,我检查了以下设置: 隐藏目录中的缺货商品"

Under "Products" and "Inventory" I have checked the following setting: "Hide out of stock items from the catalog"

现在,所有售罄的产品都隐藏在存档/类别视图中.到目前为止一切顺利.

Now all sold out products are hidden in the archive/category view. So far so good.

问题是每页计算隐藏的(缺货)产品.因此,如果首页上售罄的产品有3种,则只有库存的产品显示(6).

The problem is that the hidden (out of stock) products are counted per page. So if there are 3 products that are sold out on the first page, only the ones in stock are showing (6).

似乎这些隐藏"产品仍然可以搜索,并且可以通过不同的小部件看到.

It also seems that these "hidden" products still are searchable as well, and visible through the different widgets.

有什么办法解决此问题吗?我的意思是真正地隐藏缺货的产品.还是我需要手动将其删除?

Any ideas how to fix this? I mean to REALLY hide products that are out of stock. Or do I need to manuallly remove them?

推荐答案

注意事项:始终从开发人员那里读取变更日志.

Note to self: Always read the changelog from developer.

在此处找到答案:

如果类别的产品计数显示过高或 数字太小,更新到WooCommerce 2.1之后, 解决方法.

In case the product counts for categories are showing a too high or too low number, after updating to WooCommerce 2.1 there is an easy workaround.

转到您的WooCommerce>系统状态内的工具"标签 WordPress管理面板.在这里,您首先使用重新计算条件" 按钮,然后使用清除瞬变"按钮.这将 强制系统在下一次分类时重新计算所有产品 已加载.

Go to the ‘Tools’ tab inside the WooCommerce > System Status of your WordPress administration panel. Here you first use the ‘Recount terms’ button and after that use the ‘Clear transients’ button. This will force the system to recount all the products the next time a category is loaded.

更新:还要记住,将库存数量更改为0是不够的.您还必须将库存状态"设置为缺货".如果没有的话,即使没有库存的产品也会在商店中计算.

Update: Also remember that it is not enough to change stock quantity to 0. You must also set "Stock status" to "Out of stock". If not the product will be counted in the shop, even if there are no products in stock.

这篇关于在Woocommerce中隐藏“缺货"产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆