首页 文章

延期交货通知Woocommerce

提问于
浏览
0

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

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

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

所以,有人知道,我怎么能改变这个?是否有自定义代码或我可以使用的其他东西 .

这对我来说非常重要 . 我试着找一个解决方案大约一周没有任何运气 . 所以请帮助我 .

1 回答

  • 0

    你能试试吗?只需将此代码块复制并粘贴到子主题中的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'] .= __('
    Shipped immediately', 'custom'); } if ( $_product->is_in_stock() && $_product->backorders_allowed() ) { $availability['availability'] = __('
    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'] .= __('
    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; }

    让我知道它是否适合你 .

    谢谢

相关问题