在 Magento 中区分后端与前端购买 [英] Differentiating Backend vs. Frontend Purchases in Magento

查看:35
本文介绍了在 Magento 中区分后端与前端购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法判断订单是通过网站前端下的还是通过管理面板输入的?

Is there a way to tell if an order was placed through the frontend of the web site or entered through the administrative panel?

推荐答案

默认情况下,Magento 仅将 remote_ip 存储在表 sales_flat_order 中,用于客户下的订单(当管理员订单设置为空时).

By default, Magento only stores the remote_ip in table sales_flat_order for an order that is place by customer (while admin order is set to null).

试试这个:

if(!empty($order->getRemoteIp()){
  //place online
}
else{
  // place by admin
}

参见 以编程方式区分 admin 和客户下的订单

这篇关于在 Magento 中区分后端与前端购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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