【问题标题】:Backorder Notification Woocommerce缺货通知 Woocommerce
【发布时间】:2018-04-15 09:28:19
【问题描述】:

我的 woocommerce 商店的延期交货通知有点问题。

现在是什么:我在产品延期交货中设置:允许,但通知客户。当我在产品页面上按下变体时,它将显示可延期交货。到现在为止还挺好。当有人下订单时,它会在订单确认、pdf 发票、电子邮件中显示文本 backorderer:1。

我想要的:仅在产品信息页面上显示通知。不是关于电子邮件、订单确认等。但是当我设置延期交货时才允许。客户的产品页面上也没有通知。

那么你们当中有人知道,我该如何改变这个?是否有自定义代码或其他我可以使用的东西。

这对我来说真的很重要。我试图在没有任何运气的情况下找到大约 1 周的解决方案。所以请帮助我。

【问题讨论】:

    标签: woocommerce


    【解决方案1】:

    你可以试试这个吗? 只需将此代码块复制并粘贴到您的子主题中的 functions.php 文件中即可。

    add_filter( 'woocommerce_get_availability', 'wcs_custom_get_availability', 1, 2); function wcs_custom_get_availability( $availability, $_product ) { // Change In Stock Text if ( $_product->is_in_stock() && ! $_product->backorders_allowed() ) { $availability['availability'] .= __('<br />Shipped immediately', 'custom'); } if ( $_product->is_in_stock() && $_product->backorders_allowed() ) { $availability['availability'] = __('<br />We will inform you via email when the product is back in stock. Please send us your contact info via the form below.', 'custom'); } // Change Out of Stock Text if ( ! $_product->is_in_stock() ) { $availability['availability'] .= __('<br />We will inform you via email when the product is back in stock. Please send us your contact info via the form below.', 'custom'); } return $availability; }
    

    让我知道它是否对你有用。

    谢谢

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-11
    • 2023-03-23
    • 1970-01-01
    • 1970-01-01
    • 2014-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多