什么会导致定义的变量抛出未定义的通知? [关闭]

In opencart, I have a variable sales_representative in a foreach loop. It gets defined and put into an array, then gets out-put in a .tpl file. Everything works as it should. But I get a notice up top saying undefined index: sales_representative... If it was undefined I wouldn't be getting a result displayed... Any thoughts?

Make sure before you give it any value, initialize it first outside the loop by giving it a value of either 0 or ""