0

We purchased a bridge between Magento and SugarCRM and it works well but I only want to push the customers and their orders from a few specific customer groups in Magento because we have different divisions. The product support team sent me the following:

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

Where GROUP_NUMBER is the number of the groups you need.

So I did:

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

But it doesn't work. What am I doing wrong?

halfer
  • 19,824
  • 17
  • 99
  • 186
  • Whenever I see the phrase "it doesn't work" in a bug report, I tend to inform the writer that they should ban it from their lexicon entirely `;)`. Can you explain what you expected to happen, and what actually happened? Error messages? White screen? Is this in a web context or a cron/console script? etc. – halfer Dec 09 '13 at 22:51
  • Your code see correct, did you check to see if group id 12 exist `return (Mage::getSingleton('customer/session')->isLoggedIn() && Mage::getSingleton('customer/session')->getCustomerGroupId() == 12) ? true : false;` – MagePal Extensions Dec 10 '13 at 01:16
  • halfer thanks for your response. to clarify: when i added the condition, the contact info in the CRM wasn't updated with the recent order. no error messages, white screen etc.. this is a web context. – user3084718 Dec 10 '13 at 14:09
  • You might want to try, on a test setup, to determine what is being returned from this. So now nothing gets updated where before everything was? – Dan Dec 10 '13 at 15:15

0 Answers0