Public Member Functions | |
salesOrderShipmentTrackSaveAfter (Varien_Event_Observer $observer) | |
salesOrderShipmentSaveAfter (Varien_Event_Observer $observer) |
Definition at line 34 of file Observer.php.
salesOrderShipmentSaveAfter | ( | Varien_Event_Observer $ | observer | ) |
Definition at line 51 of file Observer.php.
00052 { 00053 $googleShipmentNames = array('googlecheckout_carrier', 'googlecheckout_merchant', 'googlecheckout_flatrate', 'googlecheckout_pickup'); 00054 00055 $shipment = $observer->getEvent()->getShipment(); 00056 $order = $shipment->getOrder(); 00057 00058 if (!in_array($order->getShippingMethod(), $googleShipmentNames)) { 00059 return; 00060 } 00061 00062 $items = array(); 00063 00064 foreach ($shipment->getAllItems() as $item) { 00065 if ($item->getOrderItem()->getParentItemId()) { 00066 continue; 00067 } 00068 $items[] = $item->getSku(); 00069 } 00070 00071 if ($items) { 00072 Mage::getModel('googlecheckout/api') 00073 ->setStoreId($order->getStoreId()) 00074 ->shipItems($order->getExtOrderId(), $items); 00075 } 00076 }
salesOrderShipmentTrackSaveAfter | ( | Varien_Event_Observer $ | observer | ) |
Definition at line 36 of file Observer.php.
00037 { 00038 $track = $observer->getEvent()->getTrack(); 00039 00040 $order = $track->getShipment()->getOrder(); 00041 00042 if ($order->getShippingMethod()!='googlecheckout_carrier') { 00043 return; 00044 } 00045 00046 Mage::getModel('googlecheckout/api') 00047 ->setStoreId($order->getStoreId()) 00048 ->deliver($order->getExtOrderId(), $track->getCarrierCode(), $track->getNumber()); 00049 }