コード例 #1
0
 /**
  * Redirect to romview after validating that correct information has actually been answered
  */
 public function viewAction()
 {
     Mage::unregister('rom_order');
     /** @var Zend_Controller_Request_Http */
     $request = $this->getRequest();
     $orderId = $request->getPost('oar_order_id');
     $orderEmail = $request->getPost('oar_email');
     $orderZip = $request->getPost('oar_zip');
     $orderLastname = $request->getPost('oar_billing_lastname');
     /** @var Mage_Core_Model_Session */
     $session = $this->_orderFactory->getCoreSessionModel();
     // Clearing out messages
     $session->getMessages(true);
     /** @var EbayEnterprise_Order_Model_Detail */
     $detailApi = $this->_orderFactory->getNewRomOrderDetailModel($orderId);
     try {
         /** @var EbayEnterprise_Order_Model_Detail_Order $romOrderObject */
         $romOrderObject = $detailApi->process();
     } catch (EbayEnterprise_Order_Exception_Order_Detail_Notfound_Exception $e) {
         $session->addError($e->getMessage());
         $this->_redirect('sales/guest/form');
         return;
     }
     if ($this->_hasValidOrderResult($romOrderObject, $orderEmail, $orderZip, $orderLastname)) {
         $this->_redirect('sales/order/romguestview', ['order_id' => $orderId]);
     } else {
         $session->addError($this->_orderHelper->__('Order not found.'));
         $this->_redirect('sales/guest/form');
     }
     return;
 }
コード例 #2
0
 /**
  * Get the store id for the order. In non-admin stores, can use the current
  * store. In admin stores, must get the order the quote is actually
  * being created in.
  * @return int
  */
 protected function _getStoreId()
 {
     $storeEnv = Mage::app()->getStore();
     if ($storeEnv->isAdmin()) {
         /** @var Mage_Adminhtml_Model_Session_Quote */
         $quoteSession = $this->_factory->getAdminQuoteSessionModel();
         // when in the admin, the store id the order is actually being created
         // for should be used instead of the admin store id - should be
         // available in the session
         $storeEnv = $quoteSession->getStore();
     }
     return $storeEnv->getId();
 }
コード例 #3
0
 /**
  * Test that the controller method ebayenterprise_order/factory::getCustomerSession()
  * is invoked and it will instantiate an object of type customer/session and return this object.
  */
 public function testGetCustomerSession()
 {
     /** @var Mock_Mage_Customer_Model_Session */
     $session = $this->getModelMockBuilder('customer/session')->disableOriginalConstructor()->getMock();
     $this->replaceByMock('singleton', 'customer/session', $session);
     $this->assertSame($session, $this->_factory->getCustomerSession());
 }
コード例 #4
0
 /**
  * @param  IShipGroup
  * @return self
  */
 protected function _extractOrderDetailShipGroupInfo(IShipGroup $shipGroup)
 {
     $shipGroupData = $this->_extractData($shipGroup, $this->_detailConfigMap[static::SHIPGROUP_DATA_KEY]);
     $shipGroupData['order'] = $this;
     $this->getShipGroupsCollection()->addItem($this->_factory->getNewDetailProcessResponseShipGroup($shipGroupData));
     return $this;
 }
コード例 #5
0
 /**
  * Process order detail payload response.
  *
  * @return EbayEnterprise_Order_Model_Detail_Process_IResponse
  * @throws EbayEnterprise_Order_Exception_Order_Detail_Notfound_Exception
  */
 protected function _processResponse()
 {
     if (!$this->_response instanceof IOrderDetailResponse) {
         throw Mage::exception('EbayEnterprise_Order_Exception_Order_Detail_Notfound', sprintf(static::ORDER_DETAIL_NOT_FOUND_EXCEPTION, $this->_orderId));
     }
     return $this->_factory->getNewDetailProcessResponse($this->_response)->process();
 }
コード例 #6
0
 /**
  * Process order summary payload response.
  *
  * @return EbayEnterprise_Order_Model_Search_Process_Response_ICollection
  * @throws EbayEnterprise_Order_Exception_Order_Detail_Notfound_Exception
  */
 protected function _processResponse()
 {
     if (is_null($this->_response)) {
         throw new EbayEnterprise_Order_Exception_Order_Detail_Notfound_Exception();
     }
     return $this->_factory->getNewSearchProcessResponse($this->_response)->process();
 }
コード例 #7
0
 /**
  * From the passed in IOrderSummaryIterable object build
  * the passed in Varien_Data_Collection object.
  *
  * @param  IOrderSummaryIterable
  * @param  EbayEnterprise_Order_Model_Search_Process_Response_ICollection
  * @return EbayEnterprise_Order_Model_Search_Process_Response_ICollection
  */
 protected function _buildResponseCollection(IOrderSummaryIterable $summaries, EbayEnterprise_Order_Model_Search_Process_Response_ICollection $collection)
 {
     /** @var IOrderSummary $summary */
     foreach ($summaries as $summary) {
         $collection->addItem($this->_factory->getNewVarienObject($this->_map->extract($summary)));
     }
     return $collection->sort();
 }
コード例 #8
0
 /**
  * injecting shipment data into order shipment tracking collection
  * @param array $data
  * @return self
  */
 protected function _injectShipmentTracks(array $data)
 {
     if (!$this->_tracks) {
         $this->_tracks = new Varien_Data_Collection();
     }
     $this->_tracks->addItem($this->factory->getNewSalesOrderShipmentTrack($data));
     return $this;
 }
コード例 #9
0
 /**
  * @see Mage_Checkout_Block_Multishipping_Success::getViewOrderUrl()
  * Overriding this method in order to redirect registered user to the correct
  * ROM order detail view page in Multi-shipping checkout success page.
  *
  * @param int
  * @return string
  */
 public function getViewOrderUrl($orderId)
 {
     $orderIds = $this->getOrderIds();
     $incrementId = isset($orderIds[$orderId]) ? $orderIds[$orderId] : null;
     Mage::register('rom_order_id', $incrementId);
     // clearing out the multi-shipping ids from core session, see the
     // Mage_Checkout_Block_Multishipping_Success::getOrderIds() method.
     $this->orderFactory->getCoreSessionModel()->getOrderIds(true);
     return $this->getUrl('sales/order/romview', ['order_id' => $incrementId]);
 }
コード例 #10
0
 public function addLink($name, $path, $label)
 {
     $this->_links[$name] = $this->_factory->getNewVarienObject(['name' => $name, 'label' => $label, 'url' => empty($path) ? '' : $this->getUrl($path, ['order_id' => $this->getOrder()->getRealOrderId()])]);
     return $this;
 }
コード例 #11
0
 /**
  * Group each bundle items and their children as a single item with options.
  *
  * @return self
  */
 protected function _groupBundleItems()
 {
     $this->_factory->getNewDetailProcessResponseRelationship($this)->process();
     return $this;
 }
コード例 #12
0
 /**
  * Get the tracking data.
  *
  * @param  EbayEnterprise_Order_Model_Detail_Process_Response_Shipment
  * @param  string
  * @return Varien_Object
  */
 protected function getTrack(EbayEnterprise_Order_Model_Detail_Process_Response_Shipment $shipment, $track)
 {
     /** @var Mage_Shipping_Model_Tracking_Result_Status | null */
     $trackingInfo = $this->getTrackingInfo($shipment, $track);
     return $this->factory->getNewVarienObject(['carrier' => $trackingInfo ? $trackingInfo->getCarrier() : $shipment->getCarrier(), 'carrier_title' => $trackingInfo ? $trackingInfo->getCarrierTitle() : $shipment->getShippingCarrierTitle(), 'tracking' => $track, 'popup' => true, 'url' => $trackingInfo ? $trackingInfo->getUrl() : null]);
 }
コード例 #13
0
 /**
  * Make ROM order summary search when we have a valid logged in customer
  * id in the customer session otherwise simply return an empty collection.
  *
  * @return Varien_Data_Collection
  */
 public function getCurCustomerOrders()
 {
     $customerId = $this->_getPrefixedCurrentCustomerId();
     return !is_null($customerId) ? $this->_factory->getNewRomOrderSearch($customerId)->process() : $this->_coreHelper->getNewVarienDataCollection();
 }
コード例 #14
0
 /**
  * Process order cancel response.
  *
  * @return self
  */
 protected function _processResponse()
 {
     $this->_factory->getNewCancelProcessResponse($this->_response, $this->_order)->process();
     return $this;
 }
コード例 #15
0
 public function handleEbayEnterpriseOrderCreateItemEvent(Varien_Event_Observer $observer)
 {
     $event = $observer->getEvent();
     $this->factory->getNewRelationshipsModel($event->getItem(), $event->getItemPayload())->injectItemRelationship();
 }
コード例 #16
0
 /**
  * Process order summary payload response.
  *
  * @return EbayEnterprise_Order_Model_Search_Process_Response_ICollection
  */
 protected function _processResponse()
 {
     return $this->_factory->getNewSearchProcessResponse($this->_response)->process();
 }