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() { $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 _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() { $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 _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 _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 \$\$('#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(); }
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(); }
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 _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 _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(['Description' => $this->__('Description')]); $this->js->addRequireJs(['l' => 'M2ePro/Log'], "window.LogObj = new Log();"); return parent::_toHtml(); }