Ejemplo n.º 1
0
 public function process()
 {
     $dispatcherObject = Mage::getModel('M2ePro/Connector_Amazon_Dispatcher');
     $connectorObj = $dispatcherObject->getConnector('custom', $this->getSearchMethod(), 'requester', $this->getConnectorParams(), $this->listingProduct->getAccount(), 'Ess_M2ePro_Model_Amazon_Search');
     $searchData = $dispatcherObject->process($connectorObj);
     return $this->prepareResult($searchData);
 }
 public function __construct(array $params = array(), Ess_M2ePro_Model_Listing_Product $listingProduct)
 {
     if (!is_null($listingProduct->getActionConfigurator())) {
         $actionConfigurator = $listingProduct->getActionConfigurator();
     } else {
         $actionConfigurator = Mage::getModel('M2ePro/Ebay_Listing_Product_Action_Configurator');
     }
     $this->listingProduct = $listingProduct->loadInstance($listingProduct->getId());
     $this->listingProduct->setActionConfigurator($actionConfigurator);
     parent::__construct($params, $this->listingProduct->getMarketplace(), $this->listingProduct->getAccount());
 }
Ejemplo n.º 3
0
 public function process(Ess_M2ePro_Model_Listing_Product $listingProduct, $query)
 {
     $searchMethod = 'byQuery';
     $tempQuery = str_replace('-', '', $query);
     if ($this->isQueryEan($tempQuery) || $this->isQueryIsbn($tempQuery)) {
         $query = $tempQuery;
         $searchMethod = 'byEanIsbn';
     }
     $params = array('query' => $query, 'type' => 'manual', 'listing_product_id' => $listingProduct->getId());
     Mage::getModel('M2ePro/Connector_Play_Dispatcher')->processConnector('search', $searchMethod, 'requester', $params, $listingProduct->getAccount(), 'Ess_M2ePro_Model_Play');
     $result = Mage::helper('M2ePro/Data_Global')->getValue('temp_play_manual_search_result');
     Mage::helper('M2ePro/Data_Global')->unsetValue('temp_play_manual_search_result');
     return $result;
 }
Ejemplo n.º 4
0
 public function process(Ess_M2ePro_Model_Listing_Product $listingProduct, $query)
 {
     $searchMethod = 'byQuery';
     if ($this->isQueryGeneralId($query) || $this->isQueryUpc($query)) {
         $searchMethod = 'byIdentifier';
     }
     $params = array('query' => $query, 'type' => 'manual', 'listing_product_id' => $listingProduct->getId());
     if ($searchMethod == 'byIdentifier') {
         $params['search_type'] = $this->getSearchType($query);
     }
     Mage::getModel('M2ePro/Connector_Buy_Dispatcher')->processConnector('search', $searchMethod, 'requester', $params, $listingProduct->getAccount(), 'Ess_M2ePro_Model_Buy');
     $result = Mage::helper('M2ePro/Data_Global')->getValue('temp_buy_manual_search_result');
     Mage::helper('M2ePro/Data_Global')->unsetValue('temp_buy_manual_search_result');
     return $result;
 }
Ejemplo n.º 5
0
 public function process(Ess_M2ePro_Model_Listing_Product $listingProduct, $query)
 {
     $searchMethod = 'byQuery';
     $validation = Mage::helper('M2ePro');
     $tempQuery = str_replace('-', '', $query);
     if (Mage::helper('M2ePro/Component_Amazon')->isASIN($tempQuery) || $validation->isISBN10($tempQuery)) {
         $query = $tempQuery;
         $searchMethod = 'byAsin';
     } elseif ($validation->isEAN($tempQuery) || $validation->isUPC($tempQuery) || $validation->isISBN13($tempQuery)) {
         $query = $tempQuery;
         $searchMethod = 'byIdentifier';
     }
     $params = array('item' => $query, 'type' => 'manual', 'only_realtime' => true, 'search_method' => $searchMethod, 'listing_product_id' => $listingProduct->getId());
     if ($searchMethod == 'byIdentifier') {
         $params['id_type'] = $this->getIdentifierType($query);
     }
     Mage::getModel('M2ePro/Connector_Amazon_Dispatcher')->processConnector('search', $searchMethod, 'requester', $params, $listingProduct->getAccount(), 'Ess_M2ePro_Model_Amazon');
     $result = Mage::helper('M2ePro/Data_Global')->getValue('temp_amazon_manual_search_result');
     Mage::helper('M2ePro/Data_Global')->unsetValue('temp_amazon_manual_search_result');
     return $result;
 }
Ejemplo n.º 6
0
 public function __construct(array $params = array(), Ess_M2ePro_Model_Listing_Product $listingProduct)
 {
     $this->listingProduct = $listingProduct;
     parent::__construct($params, $this->listingProduct->getMarketplace(), $this->listingProduct->getAccount());
 }