Exemplo n.º 1
0
 public function getDescriptionTemplateMode()
 {
     $listingAdditionalData = $this->listing->getData('additional_data');
     $listingAdditionalData = json_decode($listingAdditionalData, true);
     $mode = 'same';
     $sessionMode = $this->getHelper('Data\\Session')->getValue('products_source');
     if ($sessionMode == 'category') {
         $mode = $sessionMode;
     }
     if (!empty($listingAdditionalData['new_asin_mode'])) {
         $mode = $listingAdditionalData['new_asin_mode'];
     }
     return $mode;
 }
Exemplo n.º 2
0
 private function getCategoryAttributeLabel($attributeCode)
 {
     $attributeLabel = $this->getHelper('Magento\\Attribute')->getAttributeLabel($attributeCode, $this->listing->getData('store_id'));
     $result = $this->__('Magento Attribute') . ' -> ';
     $result .= $this->getHelper('Data')->escapeHtml($attributeLabel);
     return '<span style="padding-left: 10px; display: inline-block;">' . $result . '</span>';
 }
Exemplo n.º 3
0
 protected function addCategoriesPath(&$data, \Ess\M2ePro\Model\Listing $listing)
 {
     $marketplaceId = $listing->getData('marketplace_id');
     $accountId = $listing->getAccountId();
     if (isset($data['category_main_mode'])) {
         if ($data['category_main_mode'] == \Ess\M2ePro\Model\Ebay\Template\Category::CATEGORY_MODE_EBAY) {
             $data['category_main_path'] = $this->getHelper('Component\\Ebay\\Category\\Ebay')->getPath($data['category_main_id'], $marketplaceId);
         } else {
             $data['category_main_path'] = null;
         }
     }
     if (isset($data['category_secondary_mode'])) {
         if ($data['category_secondary_mode'] == \Ess\M2ePro\Model\Ebay\Template\Category::CATEGORY_MODE_EBAY) {
             $data['category_secondary_path'] = $this->getHelper('Component\\Ebay\\Category\\Ebay')->getPath($data['category_secondary_id'], $marketplaceId);
         } else {
             $data['category_secondary_path'] = null;
         }
     }
     if (isset($data['store_category_main_mode'])) {
         if ($data['store_category_main_mode'] == \Ess\M2ePro\Model\Ebay\Template\Category::CATEGORY_MODE_EBAY) {
             $data['store_category_main_path'] = $this->getHelper('Component\\Ebay\\Category\\Store')->getPath($data['store_category_main_id'], $accountId);
         } else {
             $data['store_category_main_path'] = null;
         }
     }
     if (isset($data['store_category_secondary_mode'])) {
         if ($data['store_category_secondary_mode'] == \Ess\M2ePro\Model\Ebay\Template\Category::CATEGORY_MODE_EBAY) {
             $data['store_category_secondary_path'] = $this->getHelper('Component\\Ebay\\Category\\Store')->getPath($data['store_category_secondary_id'], $accountId);
         } else {
             $data['store_category_secondary_path'] = null;
         }
     }
 }
Exemplo n.º 4
0
 protected function _prepareCollection()
 {
     // Get collection
     // ---------------------------------------
     /* @var $collection \Ess\M2ePro\Model\ResourceModel\Magento\Product\Collection */
     $collection = $this->magentoProductCollectionFactory->create();
     $collection->setListingProductModeOn();
     $collection->setStoreId($this->listing->getData('store_id'))->addAttributeToSelect('name')->addAttributeToSelect('sku');
     // ---------------------------------------
     // ---------------------------------------
     $listingProductsIds = $this->listing->getSetting('additional_data', 'adding_new_asin_listing_products_ids');
     $lpTable = $this->activeRecordFactory->getObject('Listing\\Product')->getResource()->getMainTable();
     $collection->joinTable(array('lp' => $lpTable), 'product_id=entity_id', array('id' => 'id'), '{{table}}.listing_id=' . (int) $this->listing->getId());
     $alpTable = $this->activeRecordFactory->getObject('Amazon\\Listing\\Product')->getResource()->getMainTable();
     $collection->joinTable(array('alp' => $alpTable), 'listing_product_id=id', array('listing_product_id' => 'listing_product_id', 'template_description_id' => 'template_description_id'));
     $collection->getSelect()->where('lp.id IN (?)', $listingProductsIds);
     $collection->getSelect()->where('alp.search_settings_status != ? OR alp.search_settings_status IS NULL', \Ess\M2ePro\Model\Amazon\Listing\Product::SEARCH_SETTINGS_STATUS_IN_PROGRESS);
     $collection->getSelect()->where('alp.general_id IS NULL');
     // ---------------------------------------
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }