【发布时间】:2014-05-08 23:44:09
【问题描述】:
这几天我一直在为此烦恼。场景是 1 家商店有 2 个地点,因此根据结帐时选择的送货国家/地区,新订单通知需要发送到相关的电子邮件地址。
我得到了这个工作....部分。
在测试阶段,为了完成订单,我使用了“直接银行转账”付款方式。下面的代码非常适合这种付款方式,但我后来发现,当通过贝宝下订单时,它不再有效。
此外,如果您将产品更改为虚拟产品,那么它可以与 paypal 一起使用,但只要您添加
add_filter( 'woocommerce_cart_needs_shipping', '__return_true' );
恢复运输选项,然后它再次停止工作。
这是我目前的代码
global $woocommerce;
if (strtolower($woocommerce->customer->get_shipping_country()) === 'us') {
$this->send( 'shopone@gmail.com', $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
} else {
$this->send( 'shoptwo@gmail.com', $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
};
希望有人能发现我遗漏的明显东西,提前谢谢!
更新: Zapier 工作但有一些限制,我仍然想找到一个不需要第三方应用程序的解决方案。
【问题讨论】:
标签: php wordpress woocommerce