[英]How to enable add to cart button for out of stock product in woocommerce?
Background: I have a Woocommerce store that is set up such that backorders are allowed for all products. 背景:我开设了一家Woocommerce商店,以便所有产品都可以延期交货。 However, despite backorders being allowed, when a product is listed as out of stock, the add to cart button disappears.
但是,尽管允许补货,但是当产品被列为缺货时,“添加到购物车”按钮将消失。 I've done a bit of research online, and it seems that around July of 2016, Woocommerce changed the backorders feature so that it would no longer allow customers to add products that are listed as out of stock to their cart.
我已经在网上进行了一些研究,似乎在2016年7月左右,Woocommerce更改了积压订单功能,以便不再允许客户将列为缺货的产品添加到购物车中。
I've heard a bunch of reasons for this change. 我已经听说了此更改的一系列原因。 However, it is important for my business to differentiate between out of stock products and in stock products--mostly to give customers notice that they will not receive out of stock products for 2-3 weeks, but in stock products will be delivered in just 3-4 days.
但是,对我的公司来说区分出库存产品和库存产品很重要-主要是要让客户注意,他们不会在2-3周内收到库存产品,而库存产品将在短时间内交付3-4天。
Does anyone have any recommendations as to how I might address this problem? 有人对我如何解决此问题有任何建议吗? I'm pretty weak at coding, FYI.
仅供参考,我的编码能力很弱。
As woocommerce provide Allow backorders feature so you don't need to do any custom code for this. 由于woocommerce提供了“允许缺货”功能,因此您无需为此执行任何自定义代码。
Please follow following steps:- 请按照以下步骤操作:
1-Keep your product in-stock. 1-将您的产品保留在库存中。
2-In back-order dropdown select =>Allow, but notify customer option. 2-在拖欠订单下拉列表中,选择=>允许,但通知客户选项。
3-Check product on frontend. 3-检查前端的产品。
Now add-to-cart button is enabled for back-orders and back order notification is also showing on the product page. 现在,添加到购物车按钮可用于延期交货,并且延期交货通知也显示在产品页面上。
May this will help you. 愿这对您有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.