protected function _prepareColumns() { $this->addColumn('title', array('header' => $this->__('Group'), 'align' => 'left', 'type' => 'text', 'escape' => true, 'index' => 'title', 'filter_index' => 'title')); $this->addColumn('categories', array('header' => $this->__('Categories'), 'align' => 'left', 'type' => 'text', 'sortable' => false, 'filter' => false, 'frame_callback' => array($this, 'callbackColumnCategories'))); $this->addColumn('action', array('header' => $this->__('Actions'), 'align' => 'left', 'type' => 'text', 'sortable' => false, 'filter' => false, 'actions' => array(0 => array('label' => $this->__('Edit Group'), 'value' => 'categoryStepOne'), 1 => array('label' => $this->__('Delete Group'), 'value' => 'categoryDeleteGroup')), 'frame_callback' => array($this, 'callbackColumnActions'))); return parent::_prepareColumns(); }
protected function _prepareColumns() { $this->addColumn('message', array('header' => $this->__('Message'), 'align' => 'left', 'width' => '*', 'type' => 'text', 'sortable' => false, 'filter_index' => 'id', 'index' => 'description', 'frame_callback' => array($this, 'callbackColumnDescription'))); $this->addColumn('type', array('header' => $this->__('Type'), 'align' => 'left', 'width' => '65px', 'index' => 'type', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnType'))); $this->addColumn('initiator', array('header' => $this->__('Run Mode'), 'align' => 'left', 'width' => '65px', 'index' => 'initiator', 'sortable' => false, 'type' => 'options', 'options' => array(\Ess\M2ePro\Helper\Data::INITIATOR_UNKNOWN => $this->__('Unknown'), \Ess\M2ePro\Helper\Data::INITIATOR_EXTENSION => $this->__('Automatic'), \Ess\M2ePro\Helper\Data::INITIATOR_USER => $this->__('Manual')), 'frame_callback' => array($this, 'callbackColumnInitiator'))); $this->addColumn('create_date', array('header' => $this->__('Create Date'), 'align' => 'left', 'width' => '165px', 'type' => 'datetime', 'format' => \IntlDateFormatter::MEDIUM, 'index' => 'create_date')); return parent::_prepareColumns(); }
protected function _prepareColumns() { $this->addColumn('transaction_id', array('header' => $this->__('Transaction #'), 'align' => 'left', 'width' => '*', 'index' => 'transaction_id', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnTransactionId'))); $this->addColumn('fee', array('header' => $this->__('Fee'), 'align' => 'left', 'width' => '100px', 'index' => 'fee', 'type' => 'number', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnFee'))); $this->addColumn('sum', array('header' => $this->__('Amount'), 'align' => 'left', 'width' => '100px', 'index' => 'sum', 'type' => 'number', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnSum'))); $this->addColumn('transaction_date', array('header' => $this->__('Date'), 'align' => 'left', 'width' => '150px', 'index' => 'transaction_date', 'type' => 'datetime', 'format' => \IntlDateFormatter::MEDIUM, 'sortable' => false)); return parent::_prepareColumns(); }
protected function _prepareColumns() { $this->addColumn('account', array('header' => $this->__('Account'), 'align' => 'left', 'type' => 'text', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnAccount'))); $this->addColumn('marketplace', array('header' => $this->__('Marketplace'), 'align' => 'left', 'type' => 'text', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnMarketplace')), 'account'); $this->addColumn('products_total_count', array('header' => $this->__('Total Items'), 'align' => 'right', 'width' => '100px', 'type' => 'number', 'index' => 'products_total_count', 'filter_index' => 'main_table.products_total_count', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnTotalProducts'))); $this->addColumn('products_active_count', array('header' => $this->__('Active Items'), 'align' => 'right', 'width' => '100px', 'type' => 'number', 'index' => 'products_active_count', 'filter_index' => 'main_table.products_active_count', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnListedProducts'))); $this->addColumn('products_inactive_count', array('header' => $this->__('Inactive Items'), 'align' => 'right', 'width' => '100px', 'type' => 'number', 'index' => 'products_inactive_count', 'filter_index' => 'main_table.products_inactive_count', 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnInactiveProducts'))); return parent::_prepareColumns(); }
protected function _prepareColumns() { $this->addColumn('create_date', array('header' => $this->__('Creation Date'), 'align' => 'left', 'width' => '150px', 'type' => 'datetime', 'format' => \IntlDateFormatter::MEDIUM, 'index' => 'create_date', 'filter_index' => 'main_table.create_date')); $this->addColumn('update_date', array('header' => $this->__('Update Date'), 'align' => 'left', 'width' => '150px', 'type' => 'datetime', 'format' => \IntlDateFormatter::MEDIUM, 'index' => 'update_date', 'filter_index' => 'main_table.update_date')); $confirm = 'Attention! By Deleting Account you delete all information on it from M2E Pro Server. '; $confirm .= 'This will cause inappropriate work of all Accounts\' copies.'; $confirm = $this->__($confirm); $this->addColumn('actions', array('header' => $this->__('Actions'), 'align' => 'left', 'width' => '150px', 'type' => 'action', 'index' => 'actions', 'filter' => false, 'sortable' => false, 'getter' => 'getId', 'actions' => array(array('caption' => $this->__('Delete'), 'class' => 'action-default scalable add primary account-delete-btn', 'url' => array('base' => '*/*/delete'), 'field' => 'id', 'confirm' => $confirm)))); return parent::_prepareColumns(); }
protected function _prepareColumns() { $this->addColumn('id', ['header' => $this->__('ID'), 'align' => 'left', 'type' => 'number', 'index' => 'id', 'filter_index' => 'main_table.id']); $this->addColumn('title', array('header' => $this->__('Title / Info'), 'align' => 'left', 'type' => 'text', 'index' => 'title', 'filter_index' => 'main_table.title', 'frame_callback' => array($this, 'callbackColumnTitle'), 'filter_condition_callback' => array($this, 'callbackFilterTitle'))); $this->addColumn('products_total_count', array('header' => $this->__('Total Items'), 'align' => 'right', 'type' => 'number', 'index' => 'products_total_count', 'filter_index' => 'main_table.products_total_count', 'frame_callback' => array($this, 'callbackColumnTotalProducts'))); $this->addColumn('products_active_count', array('header' => $this->__('Active Items'), 'align' => 'right', 'type' => 'number', 'index' => 'products_active_count', 'filter_index' => 'main_table.products_active_count', 'frame_callback' => array($this, 'callbackColumnListedProducts'))); $this->addColumn('products_inactive_count', array('header' => $this->__('Inactive Items'), 'align' => 'right', 'width' => 100, 'type' => 'number', 'index' => 'products_inactive_count', 'filter_index' => 'main_table.products_inactive_count', 'frame_callback' => array($this, 'callbackColumnInactiveProducts'))); $this->setColumns(); $this->addColumn('actions', array('header' => $this->__('Actions'), 'align' => 'left', 'type' => 'action', 'index' => 'actions', 'filter' => false, 'sortable' => false, 'getter' => 'getId', 'renderer' => '\\Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Grid\\Column\\Renderer\\Action', 'group_order' => $this->getGroupOrder(), 'actions' => $this->getColumnActionsItems())); return parent::_prepareColumns(); }
protected function _prepareColumns() { $this->addColumn('products', array('header' => $this->__('Product'), 'align' => 'left', 'width' => '*', 'index' => 'product_id', 'frame_callback' => array($this, 'callbackColumnProduct'))); $this->addColumn('stock_availability', array('header' => $this->__('Stock Availability'), 'width' => '100px', 'index' => 'is_in_stock', 'filter_index' => 'cisi.is_in_stock', 'type' => 'options', 'sortable' => false, 'options' => array(1 => $this->__('In Stock'), 0 => $this->__('Out of Stock')), 'frame_callback' => array($this, 'callbackColumnStockAvailability'))); $this->addColumn('original_price', array('header' => $this->__('Original Price'), 'align' => 'left', 'width' => '80px', 'filter' => false, 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnOriginalPrice'))); $this->addColumn('price', array('header' => $this->__('Price'), 'align' => 'left', 'width' => '80px', 'index' => 'price', 'frame_callback' => array($this, 'callbackColumnPrice'))); $this->addColumn('qty_sold', array('header' => $this->__('QTY'), 'align' => 'left', 'width' => '80px', 'index' => 'qty_purchased', 'frame_callback' => array($this, 'callbackColumnQty'))); $this->addColumn('tax_percent', array('header' => $this->__('Tax Percent'), 'align' => 'left', 'width' => '80px', 'filter' => false, 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnTaxPercent'))); $this->addColumn('row_total', array('header' => $this->__('Row Total'), 'align' => 'left', 'width' => '80px', 'filter' => false, 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnRowTotal'))); return parent::_prepareColumns(); }
protected function _prepareCollection() { $select = $this->resourceConnection->getConnection()->select()->from($this->resourceConnection->getTableName('m2epro_amazon_dictionary_specific'))->where('marketplace_id = ?', (int) $this->marketplaceId)->where('product_data_nick = ?', $this->productDataNick)->where('type != ?', \Ess\M2ePro\Model\Amazon\Template\Description\Specific::DICTIONARY_TYPE_CONTAINER)->where('xpath LIKE ?', "{$this->currentXpath}/%")->order('title ASC'); if ($this->searchQuery) { $select->where('title LIKE ?', "%{$this->searchQuery}%"); } $filteredResult = []; $queryStmt = $select->query(); while ($row = $queryStmt->fetch()) { if (in_array($row['xpath'], $this->renderedSpecifics) || in_array($row['xpath'], $this->selectedSpecifics)) { continue; } $row['data_definition'] = (array) json_decode($row['data_definition'], true); $row['is_desired'] = !empty($row['data_definition']['is_desired']) && $row['data_definition']['is_desired']; if ($this->onlyDesired && !$row['is_desired']) { continue; } $filteredResult[] = $row; } usort($filteredResult, function ($a, $b) { if ($a['is_desired'] && !$b['is_desired']) { return -1; } if ($b['is_desired'] && !$a['is_desired']) { return 1; } return $a['title'] == $b['title'] ? 0 : ($a['title'] > $b['title'] ? 1 : -1); }); $collection = $this->customCollectionFactory->create(); $collection->setConnection($this->resourceConnection->getConnection()); foreach ($filteredResult as $item) { $collection->addItem(new \Magento\Framework\DataObject($item)); } $collection->setCustomSize(count($filteredResult)); $this->setCollection($collection); parent::_prepareCollection(); $collection->setCustomIsLoaded(true); return $this; }
protected function _prepareColumns() { $this->addColumn('title', array('header' => $this->__('Title'), 'align' => 'left', 'type' => 'text', 'index' => 'title', 'escape' => true, 'filter_index' => 'main_table.title')); $options = array(\Ess\M2ePro\Model\Ebay\Template\Manager::TEMPLATE_PAYMENT => $this->__('Payment'), \Ess\M2ePro\Model\Ebay\Template\Manager::TEMPLATE_SHIPPING => $this->__('Shipping'), \Ess\M2ePro\Model\Ebay\Template\Manager::TEMPLATE_RETURN_POLICY => $this->__('Return'), \Ess\M2ePro\Model\Ebay\Template\Manager::TEMPLATE_SELLING_FORMAT => $this->__('Price, Quantity and Format'), \Ess\M2ePro\Model\Ebay\Template\Manager::TEMPLATE_DESCRIPTION => $this->__('Description'), \Ess\M2ePro\Model\Ebay\Template\Manager::TEMPLATE_SYNCHRONIZATION => $this->__('Synchronization')); $this->addColumn('nick', array('header' => $this->__('Type'), 'align' => 'left', 'type' => 'options', 'width' => '100px', 'sortable' => false, 'index' => 'nick', 'filter_index' => 'main_table.nick', 'options' => $options)); $this->addColumn('marketplace', array('header' => $this->__('Marketplace'), 'align' => 'left', 'type' => 'options', 'width' => '100px', 'index' => 'marketplace', 'filter_index' => 'main_table.marketplace', 'filter_condition_callback' => array($this, 'callbackFilterMarketplace'), 'frame_callback' => array($this, 'callbackColumnMarketplace'), 'options' => $this->getEnabledMarketplaceTitles())); $this->addColumn('create_date', array('header' => $this->__('Creation Date'), 'align' => 'left', 'width' => '150px', 'type' => 'datetime', 'index' => 'create_date', 'filter_index' => 'main_table.create_date')); $this->addColumn('update_date', array('header' => $this->__('Update Date'), 'align' => 'left', 'width' => '150px', 'type' => 'datetime', 'index' => 'update_date', 'filter_index' => 'main_table.update_date')); $this->addColumn('actions', array('header' => $this->__('Actions'), 'align' => 'left', 'width' => '100px', 'type' => 'action', 'index' => 'actions', 'filter' => false, 'sortable' => false, 'getter' => 'getTemplateId', 'actions' => array(array('caption' => $this->__('Edit'), 'url' => array('base' => '*/ebay_template/edit', 'params' => array('nick' => '$nick')), 'field' => 'id'), array('caption' => $this->__('Delete'), 'url' => array('base' => '*/ebay_template/delete', 'params' => array('nick' => '$nick')), 'field' => 'id', 'confirm' => $this->__('Are you sure?'))))); return parent::_prepareColumns(); }
protected function _toHtml() { $tempGridIds = array(); $this->getHelper('Component\\Amazon')->isEnabled() && ($tempGridIds[] = $this->getId()); $tempGridIds = json_encode($tempGridIds); $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Model\\Log\\AbstractLog')); $this->jsUrl->addUrls(['ebay_order/view' => $this->getUrl('*/ebay_order/view', array('back' => $this->getHelper('Data')->makeBackUrlParam('*/ebay_order/index'))), 'amazon_order/view' => $this->getUrl('*/amazon_order/view', array('back' => $this->getHelper('Data')->makeBackUrlParam('*/amazon_order/index')))]); $this->jsTranslator->add('View All Order Logs', $this->__('View All Order Logs')); $this->js->add(<<<JS require([ 'M2ePro/Order', ], function(){ window.OrderObj = new Order('{$tempGridIds}'); OrderObj.initializeGrids(); }); JS ); return parent::_toHtml(); }
protected function _prepareLayout() { $this->css->addFile('log/grid.css'); parent::_prepareLayout(); }
protected function _toHtml() { // --------------------------------------- if ($this->hideMassactionDropDown) { $this->css->add(<<<CSS #{$this->getHtmlId()}_massaction .admin__grid-massaction-form { display: none; } #{$this->getHtmlId()}_massaction .mass-select-wrap { margin-left: -17.4rem; } CSS ); } // --------------------------------------- // TODO NOT SUPPORTED FEATURES "Advanced filters" // --------------------------------------- // $isShowRuleBlock = json_encode($this->isShowRuleBlock()); // $commonJs = <<<HTML //<script type="text/javascript"> // var init = function() { // if ({$isShowRuleBlock}) { // $('listing_product_rules').show(); // if ($('advanced_filter_button')) { // $('advanced_filter_button').simulate('click'); // } // } // }; // // {$this->isAjax} ? init() // : Event.observe(window, 'load', init); //</script> //HTML; // --------------------------------------- if ($this->getRequest()->isXmlHttpRequest()) { return parent::_toHtml(); } // --------------------------------------- $helper = $this->getHelper('Data'); $this->jsTranslator->addTranslations(['Please select the Products you want to perform the Action on.' => $helper->escapeJs($this->__('Please select the Products you want to perform the Action on.'))]); // --------------------------------------- $this->js->add(<<<JS require([ 'M2ePro/Magento/Product/Grid' ], function(){ window.ProductGridObj = new MagentoProductGrid(); ProductGridObj.setGridId('{$this->getJsObjectName()}'); // TODO NOT SUPPORTED FEATURES "Advanced filters" // var init = function () { // {$this->getJsObjectName()}.doFilter = ProductGridObj.setFilter; // {$this->getJsObjectName()}.resetFilter = ProductGridObj.resetFilter; // }; // // {$this->isAjax} ? init() : Event.observe(window, 'load', init); }); JS ); return parent::_toHtml(); // $commonJs; }
protected function _beforeToHtml() { if ($this->getRequest()->isXmlHttpRequest() || $this->getRequest()->getParam('isAjax')) { $this->js->addRequireJs(['jQuery' => 'jquery'], <<<JS EbayListingOtherGridObj.afterInitPage(); JS ); } return parent::_beforeToHtml(); }
protected function _beforeToHtml() { $this->js->addOnReadyJs(<<<JS \$\$('#listingOtherMappingGrid div.grid th').each(function(el) { el.style.padding = '2px 4px'; }); \$\$('#listingOtherMappingGrid div.grid td').each(function(el) { el.style.padding = '2px 4px'; }); JS ); return parent::_beforeToHtml(); }
protected function _toHtml() { $allIdsStr = $this->getGridIdsJson(); if ($this->getRequest()->isXmlHttpRequest()) { $this->js->add(<<<JS EbayListingProductCategorySettingsModeProductGridObj.afterInitPage(); EbayListingProductCategorySettingsModeProductGridObj.getGridMassActionObj().setGridIds('{$allIdsStr}'); JS ); return parent::_toHtml(); } // --------------------------------------- $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Ebay\\Listing\\Product\\Category\\Settings', array('_current' => true))); $this->jsUrl->add($this->getUrl('*/ebay_listing_product_category_settings', array('step' => 3, '_current' => true)), 'ebay_listing_product_category_settings'); $this->jsUrl->add($this->getUrl('*/ebay_category/getChooserEditHtml', array('account_id' => $this->listing->getAccountId(), 'marketplace_id' => $this->listing->getMarketplaceId())), 'ebay_category/getChooserEditHtml'); // --------------------------------------- // --------------------------------------- $translations = array(); // M2ePro_TRANSLATIONS // You have not selected the Primary eBay Category for some Products. $text = 'You have not selected the Primary eBay Category for some Products.'; $translations[$text] = $this->__($text); // M2ePro_TRANSLATIONS // Are you sure? $text = 'Are you sure?'; $translations[$text] = $this->__($text); // M2ePro_TRANSLATIONS // eBay could not assign Categories for %product_tite% Products. $text = 'eBay could not assign Categories for %product_title% Products.'; $translations[$text] = $this->__($text); // M2ePro_TRANSLATIONS // Suggested Categories were successfully Received for %product_title% Product(s). $text = 'Suggested Categories were successfully Received for %product_title% Product(s).'; $translations[$text] = $this->__($text); // M2ePro_TRANSLATIONS // Set eBay Category $text = 'Set eBay Category'; $translations[$text] = $this->__($text); // M2ePro_TRANSLATIONS // Set eBay Category for Product(s) $text = 'Set eBay Category for Product(s)'; $translations[$text] = $this->__($text); // M2ePro_TRANSLATIONS // Set eBay Primary Category for Product(s) $text = 'Set eBay Primary Category for Product(s)'; $translations[$text] = $this->__($text); $this->jsTranslator->addTranslations($translations); // --------------------------------------- // --------------------------------------- $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Helper\\Component\\Ebay\\Category')); // --------------------------------------- $getSuggested = json_encode((bool) $this->getHelper('Data\\GlobalData')->getValue('get_suggested')); $this->js->addOnReadyJs(<<<JS require([ 'M2ePro/Ebay/Listing/Product/Category/Settings/Mode/Product/Grid', 'M2ePro/Ebay/Listing/Product/Category/Settings/Mode/Product/SuggestedSearch', 'M2ePro/Plugin/ProgressBar', 'M2ePro/Plugin/AreaWrapper' ], function(){ window.WrapperObj = new AreaWrapper('products_container'); window.ProgressBarObj = new ProgressBar('products_progress_bar'); window.EbayListingProductCategorySettingsModeProductGridObj = new EbayListingProductCategorySettingsModeProductGrid('{$this->getId()}'); EbayListingProductCategorySettingsModeProductSuggestedSearchObj = new EbayListingProductCategorySettingsModeProductSuggestedSearch(); EbayListingProductCategorySettingsModeProductGridObj.afterInitPage(); EbayListingProductCategorySettingsModeProductGridObj.getGridMassActionObj().setGridIds('{$allIdsStr}'); if ({$getSuggested}) { EbayListingProductCategorySettingsModeProductGridObj.getSuggestedCategoriesForAll(); } }) JS ); return parent::_toHtml(); }
protected function _prepareColumns() { $this->addColumn('title', array('header' => $this->__('Title'), 'align' => 'left', 'type' => 'text', 'index' => 'title', 'escape' => true, 'filter_index' => 'main_table.title')); $options = array(self::TEMPLATE_SELLING_FORMAT => $this->__('Selling Format'), self::TEMPLATE_SYNCHRONIZATION => $this->__('Synchronization')); $this->addColumn('type', array('header' => $this->__('Type'), 'align' => 'left', 'type' => 'options', 'width' => '120px', 'sortable' => false, 'index' => 'type', 'filter_index' => 'main_table.type', 'options' => $options)); $this->addColumn('marketplace', array('header' => $this->__('Marketplace'), 'align' => 'left', 'type' => 'options', 'width' => '100px', 'index' => 'marketplace_id', 'filter_index' => 'marketplace_id', 'filter_condition_callback' => array($this, 'callbackFilterMarketplace'), 'frame_callback' => array($this, 'callbackColumnMarketplace'), 'options' => $this->getEnabledMarketplaceTitles()), 'type'); $this->addColumn('create_date', array('header' => $this->__('Creation Date'), 'align' => 'left', 'width' => '150px', 'type' => 'datetime', 'index' => 'create_date', 'filter_index' => 'main_table.create_date')); $this->addColumn('update_date', array('header' => $this->__('Update Date'), 'align' => 'left', 'width' => '150px', 'type' => 'datetime', 'index' => 'update_date', 'filter_index' => 'main_table.update_date')); $this->addColumn('actions', array('header' => $this->__('Actions'), 'align' => 'left', 'width' => '100px', 'type' => 'action', 'index' => 'actions', 'filter' => false, 'sortable' => false, 'getter' => 'getTemplateId', 'actions' => array(array('caption' => $this->__('Edit'), 'url' => array('base' => '*/amazon_template/edit', 'params' => array('type' => '$type')), 'field' => 'id'), array('caption' => $this->__('Delete'), 'url' => array('base' => '*/amazon_template/delete', 'params' => array('type' => '$type')), 'field' => 'id', 'confirm' => $this->__('Are you sure?'))))); parent::_prepareColumns(); $options = array(self::TEMPLATE_SELLING_FORMAT => $this->__('Selling Format'), self::TEMPLATE_DESCRIPTION => $this->__('Description'), self::TEMPLATE_SYNCHRONIZATION => $this->__('Synchronization')); $this->getColumn('type')->setData('options', $options); $this->getColumn('title')->setData('header', $this->__('Title / Description Policy Category')); $this->getColumn('title')->setData('frame_callback', array($this, 'callbackColumnTitle')); $this->getColumn('title')->setData('filter_condition_callback', array($this, 'callbackFilterTitle')); return $this; }
protected function _toHtml() { $this->jsTranslator->addTranslations(['Description' => $this->__('Description')]); $this->js->addRequireJs(['l' => 'M2ePro/Log'], "window.LogObj = new Log();"); return parent::_toHtml(); }
protected function _toHtml() { $urls = array('ebay_listing_variation_product_manage/setIdentifiers' => $this->getUrl('*/ebay_listing_variation_product_manage/setIdentifiers')); $urls = json_encode($urls); $this->js->addRequireJs(['vpmvg' => 'M2ePro/Ebay/Listing/VariationProductManageVariationsGrid'], <<<JS M2ePro.url.add({$urls}); window.VariationsGridObj = new EbayListingVariationProductManageVariationsGrid( 'ebayVariationProductManageGrid' ); setTimeout(function() { if (typeof VariationsGridObj != 'undefined') { VariationsGridObj.afterInitPage(); } }, 350); JS ); return parent::_toHtml(); }
protected function _toHtml() { $this->jsUrl->add($this->getNewTemplateDescriptionUrl(), 'newTemplateDescriptionUrl'); $this->js->add(<<<JS \$\$('#amazonTemplateDescriptionGrid div.grid th').each(function(el) { el.style.padding = '5px 5px'; }); \$\$('#amazonTemplateDescriptionGrid div.grid td').each(function(el) { el.style.padding = '5px 5px'; }); JS ); return parent::_toHtml(); }
protected function _toHtml() { $this->jsTranslator->addTranslations(['help_icon_magento_greater_left' => $this->__('This Amazon Attribute and its Value are virtualized based ' . 'on the selected Magento Variational Attribute and its Value as physically this Amazon Attribute ' . 'does not exist.'), 'help_icon_magento_greater_right' => $this->__('Select a particular Option of the Attribute to fix ' . 'it for virtualized Amazon Attribute. Please, be thoughtful as only those Variations of ' . 'Magento Product which contains the selected Option can be sold on Amazon.'), 'help_icon_amazon_greater_left' => $this->__('This Magento Attribute and its Value are virtualized ' . 'based on the selected Amazon Variational Attribute and its Value as physically this ' . 'Magento Attribute does not exist.'), 'help_icon_amazon_greater_right' => $this->__('Select a particular Option of the Attribute to fix ' . 'it for virtualized Magento Attribute. Please, be thoughtful as your offer will be available only ' . 'for those Buyers who selected the same Option.'), 'duplicate_magento_attribute_error' => $this->__('The Magento Attributes which you selected in ' . 'your settings have the same Labels. Such combination is invalid. Please, add the valid combination ' . 'of Attributes.'), 'duplicate_amazon_attribute_error' => $this->__('The Amazon Attributes which you selected in ' . 'your settings have the same Labels. Such combination is invalid. Please, add the valid combination ' . 'of Attributes.'), 'change_option' => $this->__('Change option')]); $searchData = $this->getHelper('Data\\GlobalData')->getValue('search_data'); $searchParamsHtml = <<<HTML <input id="amazon_asin_search_type" type="hidden" value="{$searchData['type']}"> <input id="amazon_asin_search_value" type="hidden" value="{$searchData['value']}"> <div id="product_search_help_icon_tpl" style="display: none"> <div class="m2epro-field-tooltip m2epro-field-tooltip-right admin__field-tooltip" style="display: inline-block"> <a class="admin__field-tooltip-action" href="javascript://"></a> <div class="admin__field-tooltip-content"> <span class="tool-tip-message-text"></span> </div> </div> </div> HTML; return parent::_toHtml() . $searchParamsHtml; }
protected function _prepareColumns() { $this->addColumn('product_id', array('header' => $this->__('Product ID'), 'align' => 'right', 'width' => '100px', 'type' => 'number', 'index' => 'product_id', 'filter_index' => 'main_table.product_id', 'frame_callback' => array($this, 'callbackColumnProductId'))); $this->addColumn('product_name', array('header' => $this->__('Product Title / Listing / Product SKU'), 'align' => 'left', 'type' => 'text', 'index' => 'product_name', 'filter_index' => 'product_name', 'frame_callback' => array($this, 'callbackColumnProductTitle'), 'filter_condition_callback' => array($this, 'callbackFilterTitle'))); $this->addColumn('ebay_item_id', array('header' => $this->__('Item ID'), 'align' => 'left', 'width' => '100px', 'type' => 'text', 'index' => 'ebay_item_id', 'filter_index' => 'ebay_item_id', 'frame_callback' => array($this, 'callbackColumnEbayItemId'))); $this->addColumn('online_qty', array('header' => $this->__('Available QTY'), 'align' => 'right', 'width' => '50px', 'type' => 'number', 'index' => 'online_qty', 'filter_index' => 'online_qty', 'frame_callback' => array($this, 'callbackColumnOnlineAvailableQty'))); $this->addColumn('online_qty_sold', array('header' => $this->__('Sold QTY'), 'align' => 'right', 'width' => '50px', 'type' => 'number', 'index' => 'online_qty_sold', 'filter_index' => 'online_qty_sold', 'frame_callback' => array($this, 'callbackColumnOnlineQtySold'))); $dir = $this->getParam($this->getVarNameDir(), $this->_defaultDir); if ($dir == 'desc') { $priceSortField = 'max_online_price'; } else { $priceSortField = 'min_online_price'; } $this->addColumn('price', array('header' => $this->__('Price'), 'align' => 'right', 'width' => '50px', 'type' => 'number', 'index' => $priceSortField, 'filter_index' => $priceSortField, 'frame_callback' => array($this, 'callbackColumnPrice'), 'filter_condition_callback' => array($this, 'callbackFilterPrice'))); $this->addColumn('status', array('header' => $this->__('Status'), 'width' => '100px', 'index' => 'status', 'filter_index' => 'status', 'type' => 'options', 'sortable' => false, 'options' => array(\Ess\M2ePro\Model\Listing\Product::STATUS_NOT_LISTED => $this->__('Not Listed'), \Ess\M2ePro\Model\Listing\Product::STATUS_LISTED => $this->__('Listed'), \Ess\M2ePro\Model\Listing\Product::STATUS_HIDDEN => $this->__('Listed (Hidden)'), \Ess\M2ePro\Model\Listing\Product::STATUS_SOLD => $this->__('Sold'), \Ess\M2ePro\Model\Listing\Product::STATUS_STOPPED => $this->__('Stopped'), \Ess\M2ePro\Model\Listing\Product::STATUS_FINISHED => $this->__('Finished'), \Ess\M2ePro\Model\Listing\Product::STATUS_BLOCKED => $this->__('Pending')), 'frame_callback' => array($this, 'callbackColumnStatus'))); $this->addColumn('goto_listing_item', array('header' => $this->__('Manage'), 'align' => 'center', 'width' => '50px', 'type' => 'text', 'filter' => false, 'sortable' => false, 'frame_callback' => array($this, 'callbackColumnActions'))); return parent::_prepareColumns(); }
protected function _toHtml() { if ($this->getRequest()->isXmlHttpRequest()) { $this->js->add(<<<JS ListingGridHandlerObj.afterInitPage(); JS ); return parent::_toHtml(); } $showNotCompletedPopup = ''; if ($this->getRequest()->getParam('not_completed', false)) { $showNotCompletedPopup = 'ListingGridHandlerObj.showNotCompletedPopup();'; } $this->js->add(<<<JS require([ 'M2ePro/Amazon/Listing/Product/Add/SearchAsin/Grid' ],function() { ListingGridHandlerObj = new AmazonListingProductAddSearchAsinGrid( '{$this->getId()}', {$this->listing->getId()} ); ListingGridHandlerObj.actionHandler.setOptions(M2ePro); ListingGridHandlerObj.productSearchHandler.setOptions(M2ePro); ListingGridHandlerObj.afterInitPage(); {$showNotCompletedPopup} }); JS ); if (!$this->listing->getChildObject()->isGeneralIdAttributeMode() && !$this->listing->getChildObject()->isWorldwideIdAttributeMode()) { if (!$this->listing->getChildObject()->isSearchByMagentoTitleModeEnabled()) { $gridId = $this->getId(); $this->js->add(<<<JS var mmassActionEl = \$("{$gridId}_massaction-select"); if (mmassActionEl && mmassActionEl.select('option[value="assignGeneralId"]').length > 0) { var assignGeneralIdOption = mmassActionEl.select('option[value="assignGeneralId"]')[0]; assignGeneralIdOption.disabled = true; mmassActionEl.insert({bottom: assignGeneralIdOption.remove()}); } JS ); } } else { $autoSearchSetting = $this->listing->getSetting('additional_data', 'auto_search_was_performed'); if (!$autoSearchSetting) { $this->listing->setSetting('additional_data', 'auto_search_was_performed', 1); $this->listing->save(); $this->js->add(<<<JS ListingGridHandlerObj.getGridMassActionObj().selectAll(); ListingGridHandlerObj.productSearchHandler.searchGeneralIdAuto(ListingGridHandlerObj.getSelectedProductsString()); JS ); } } return parent::_toHtml(); }
protected function _prepareCollection() { $collection = $this->productModel->getCollection()->addAttributeToSelect('sku')->addAttributeToSelect('name')->addAttributeToSelect('type_id')->joinField('qty', 'cataloginventory_stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left')->joinField('is_in_stock', 'cataloginventory_stock_item', 'is_in_stock', 'product_id=entity_id', '{{table}}.stock_id=1', 'left'); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _toHtml() { $this->jsUrl->add($this->getUrl('*/amazon_listing/getAFNQtyBySku'), 'amazon_listing/getAFNQtyBySku'); $this->js->addRequireJs(['alq' => 'M2ePro/Amazon/Listing/AfnQty'], <<<JS window.AmazonListingAfnQtyObj = new AmazonListingAfnQty(); JS ); return parent::_toHtml(); }
public function setCollection($collection) { $this->_prepareCache(clone $collection); parent::setCollection($collection); }
protected function _toHtml() { $buttonBlockHtml = $this->canDisplayContainer() ? $this->getNewListingBtnHtml() : ''; $this->js->add(<<<JS var warning_msg_block = \$('empty_grid_warning'); warning_msg_block && warning_msg_block.remove(); \$\$('#listingMovingGrid div.grid th').each(function(el) { el.style.padding = '2px 4px'; }); \$\$('#listingMovingGrid div.grid td').each(function(el) { el.style.padding = '2px 4px'; }); JS ); return $this->getHelpBlockHtml() . parent::_toHtml() . $buttonBlockHtml; }
protected function _toHtml() { $this->js->add(<<<JS require([ 'M2ePro/Amazon/Listing/Product/Variation/Manage/Tabs/Variations/Grid' ], function(){ ListingProductVariationManageVariationsGridObj.afterInitPage(); }); JS ); return parent::_toHtml(); }
protected function _toHtml() { $this->js->add(<<<JS \$\$('#listingFailedProductsGrid div.grid th').each(function(el) { el.style.padding = '4px'; }); \$\$('#listingFailedProductsGrid div.grid td').each(function(el) { el.style.padding = '4px'; }); JS ); return parent::_toHtml(); }