Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created May 1, 2014 16:11
Show Gist options
  • Select an option

  • Save ryaan-anthony/0755645a50e61f13578e to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/0755645a50e61f13578e to your computer and use it in GitHub Desktop.
public function sendVendorNotification($po, $comment='')
{
$vendor = $po->getVendor();
$method = $vendor->getNewOrderNotifications();
if (!$method || $method=='0') {
return $this;
}
$data = compact('vendor', 'po', 'method');
if ($method=='1') {
$this->sendNewPoNotificationEmail($po, $comment);
} else {
$config = Mage::getConfig()->getNode('global/udropship/notification_methods/'.$method);
if ($config) {
$cb = explode('::', (string)$config->callback);
$obj = Mage::getSingleton($cb[0]);
$method = $cb[1];
$obj->$method($data);
}
}
Mage::dispatchEvent('udpo_send_vendor_notification', $data);
return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment