protected function _toHtml() { // --------------------------------------- if ($this->getRequest()->isXmlHttpRequest()) { return parent::_toHtml(); } // --------------------------------------- $helper = $this->getHelper('Data'); $this->jsTranslator->addTranslations(['Are you sure you want to create empty Listing?' => $helper->escapeJs($this->__('Are you sure you want to create empty Listing?'))]); // --------------------------------------- // $this->js->add( // <<<JS // require([ // ], function(){ // // }); //JS // ); return parent::_toHtml(); }
protected function _toHtml() { if ($this->getRequest()->isXmlHttpRequest()) { return parent::_toHtml(); } $selectItemsMessage = 'Please select the Products you want to perform the Action on.'; $createEmptyListingMessage = 'Are you sure you want to create empty Listing?'; $showAdvancedFilterButtonText = 'Show Advanced Filter'; $hideAdvancedFilterButtonText = 'Hide Advanced Filter'; // --------------------------------------- $this->jsTranslator->addTranslations([$selectItemsMessage => $this->__($selectItemsMessage), $createEmptyListingMessage => $this->__($createEmptyListingMessage), $showAdvancedFilterButtonText => $this->__($showAdvancedFilterButtonText), $hideAdvancedFilterButtonText => $this->__($hideAdvancedFilterButtonText)]); // --------------------------------------- $this->jsUrl->add($this->getUrl('*/amazon_listing_product_add/add', array('_current' => true, 'step' => null)), 'add_products'); $this->jsUrl->add($this->getUrl('*/*/index'), 'back'); $this->js->add(<<<JS require([ 'M2ePro/Amazon/Listing/Product/Add', 'M2ePro/Listing/Product/Grid', 'M2ePro/Plugin/AreaWrapper', 'M2ePro/Plugin/ProgressBar' ], function(){ WrapperObj = new AreaWrapper('add_products_container'); ProgressBarObj = new ProgressBar('add_products_progress_bar'); AddListingObj = new AmazonListingProductAdd(ProgressBarObj, WrapperObj); AddListingObj.listing_id = '{$this->getRequest()->getParam('id')}'; ListingProductGridObj = new ListingProductGrid(AddListingObj); ListingProductGridObj.setGridId('{$this->getId()}'); }); JS ); return parent::_toHtml(); }
protected function _toHtml() { if ($this->getRequest()->isXmlHttpRequest()) { $this->js->add(<<<JS ListingGridHandlerObj.afterInitPage(); JS ); } return parent::_toHtml(); }
protected function _toHtml() { if ($this->getRequest()->isXmlHttpRequest()) { return parent::_toHtml(); } // --------------------------------------- $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Ebay\\Listing\\AutoAction', array('id' => $this->listing->getId()))); $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Ebay\\Listing\\Product\\Add', array('_current' => true))); $this->jsUrl->add($this->getUrl('*/ebay_listing_product_add', array('_current' => true, 'step' => null)), 'ebay_listing_product_add'); $this->jsUrl->add($this->getUrl('*/ebay_listing_product_category_settings', array('_current' => true, 'step' => null)), 'ebay_listing_product_category_settings'); // --------------------------------------- // --------------------------------------- $this->jsTranslator->addTranslations(['eBay Categories' => $this->__('eBay Categories'), 'of Product' => $this->__('of Product'), 'Specifics' => $this->__('Specifics'), 'Auto Add/Remove Rules' => $this->__('Auto Add/Remove Rules'), 'Based on Magento Categories' => $this->__('Based on Magento Categories'), 'You must select at least 1 Category.' => $this->__('You must select at least 1 Category.'), 'Rule with the same Title already exists.' => $this->__('Rule with the same Title already exists.'), 'Listing Settings Customization' => $this->__('Listing Settings Customization')]); // --------------------------------------- // --------------------------------------- $showAutoActionPopup = !$this->getHelper('Module')->getConfig()->getGroupValue('/view/ebay/advanced/autoaction_popup/', 'shown'); $showAutoActionPopup = json_encode($showAutoActionPopup); // --------------------------------------- $this->js->add(<<<JS require([ 'M2ePro/Ebay/Listing/Product/Add', 'M2ePro/Plugin/AreaWrapper', 'M2ePro/Plugin/ProgressBar', 'M2ePro/Ebay/Listing/AutoAction' ], function(){ window.WrapperObj = new AreaWrapper('add_products_container'); window.ProgressBarObj = new ProgressBar('add_products_progress_bar'); window.ListingProductAddObj = new EbayListingProductAdd({ show_autoaction_popup: {$showAutoActionPopup}, get_selected_products: {$this->getSelectedProductsCallback()} }); window.ListingAutoActionObj = new EbayListingAutoAction(); }); JS ); return parent::_toHtml(); }