Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/247.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Magento to CRM:我只想触发特定客户群的操作_Php_Magento_Sugarcrm - Fatal编程技术网

Php Magento to CRM:我只想触发特定客户群的操作

Php Magento to CRM:我只想触发特定客户群的操作,php,magento,sugarcrm,Php,Magento,Sugarcrm,我们在Magento和SugarCRM之间购买了一座桥梁,它运行良好,但我只想从Magento的几个特定客户群中推送客户及其订单,因为我们有不同的部门。产品支持团队向我发送了以下信息: if(Mage::getSingleton('customer/session')->isLoggedIn() && Mage::getSingleton('customer/session')->getCustomerGroupId() == GROUP_NUMBER) return

我们在Magento和SugarCRM之间购买了一座桥梁,它运行良好,但我只想从Magento的几个特定客户群中推送客户及其订单,因为我们有不同的部门。产品支持团队向我发送了以下信息:

if(Mage::getSingleton('customer/session')->isLoggedIn() && Mage::getSingleton('customer/session')->getCustomerGroupId() == GROUP_NUMBER) return true; else return false;
其中
GROUP\u NUMBER
是您需要的组数

所以我做了:

if(Mage::getSingleton('customer/session')->isLoggedIn() && Mage::getSingleton('customer/session')->getCustomerGroupId() == 12) return true; else return false;

但它不起作用。我做错了什么?

每当我在bug报告中看到“它不起作用”这个短语时,我都倾向于告诉作者,他们应该完全从词典中禁止这个短语(
;)。你能解释一下你预期会发生什么,以及实际发生了什么吗?错误消息?白色屏幕?这是在web上下文中还是在cron/console脚本中?等等。您的代码看起来是正确的,您是否检查组id 12是否存在
return(Mage::getSingleton('customer/session')->isLoggedIn()&&Mage::getSingleton('customer/session')->getCustomerGroupId()==12)?真:假哈弗谢谢您的回复。澄清一下:当我添加条件时,CRM中的联系信息没有随着最近的订单更新。无错误消息、白色屏幕等。。这是一个web上下文。您可能希望在测试设置中尝试确定从该上下文返回的内容。所以现在什么都没有更新,一切都是以前的吗?