Example #1
0
 public function getGridHtml()
 {
     // ---------------------------------------
     $editItemBlock = $this->createBlock('Order\\Item\\Edit');
     // ---------------------------------------
     return $editItemBlock->toHtml() . parent::getGridHtml();
 }
Example #2
0
    public function getGridHtml()
    {
        $this->js->add(<<<JS
    require([
        'M2ePro/Amazon/Listing/Product/Variation/Manage/Tabs/Variations/Grid',
        'M2ePro/Amazon/Listing/AfnQty'
    ], function(){
          
        ListingProductVariationManageVariationsGridObj = new AmazonListingProductVariationManageTabsVariationsGrid(
            '{$this->getChildBlock('grid')->getId()}',
            {$this->getListingProduct()->getListingId()}
        );
           
        ListingProductVariationManageVariationsGridObj.actionHandler
            .setProgressBar('listing_product_variation_progress_bar');
        ListingProductVariationManageVariationsGridObj.actionHandler
            .setGridWrapper('listing_product_variation_content_container');        
        ListingProductVariationManageVariationsGridObj.actionHandler
            .setErrorsSummaryContainer('listing_product_variation_errors_summary_container');
        ListingProductVariationManageVariationsGridObj.actionHandler
            .setActionMessagesContainer('listing_product_variation_action_messages_container');
    
        // TODO
        // AmazonListingAfnQtyObj = new AmazonListingAfnQty();       
    });
JS
);
        return parent::getGridHtml();
    }
Example #3
0
    protected function _toHtml()
    {
        // TEXT
        $this->jsTranslator->addTranslations(['templateDescriptionPopupTitle' => $this->__('Assign Description Policy'), 'setDescriptionPolicy' => $this->__('Set Description Policy.'), 'Add New Description Policy' => $this->__('Add New Description Policy')]);
        // ---------------------------------------
        // URL
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Template\\Description'));
        $this->jsUrl->add($this->getUrl('*/amazon_listing_product_template_description/viewTemplateDescriptionsGrid', ['map_to_template_js_fn' => 'selectTemplateDescription']), 'amazon_listing_product_template_description/viewTemplateDescriptionsGrid');
        $this->jsUrl->add($this->getUrl('*/amazon_listing_product_add/checkNewAsinManualProducts', ['_current' => true]), 'amazon_listing_product_add/checkNewAsinManualProducts');
        // ---------------------------------------
        $this->js->add(<<<JS
    selectTemplateDescription = function (el, templateId, mapToGeneralId)
    {
        ListingGridHandlerObj.mapToTemplateDescription(el, templateId, mapToGeneralId);
    };

    require([
        'M2ePro/Amazon/Listing/Product/Add/NewAsin/Template/Description/Grid',
    ],function() {
        Common.prototype.scrollPageToTop = function() { return; }

        window.ListingGridHandlerObj = new AmazonListingProductAddNewAsinTemplateDescriptionGrid(
            '{$this->getChildBlock('grid')->getId()}',
            {$this->getRequest()->getParam('id')}
        );

        ListingGridHandlerObj.afterInitPage();
   
        ListingGridHandlerObj.actionHandler.setOptions(M2ePro);
    });
JS
);
        return '<div id="search_asin_products_container">' . parent::_toHtml() . '</div>';
    }
Example #4
0
 protected function _prepareLayout()
 {
     if ($this->getListingOtherId()) {
         $this->appendHelpBlock(['content' => $this->__('
             This Log contains all information about Actions, which were done on 3rd Party Listings.')]);
     }
     return parent::_prepareLayout();
 }
Example #5
0
 public function getGridHtml()
 {
     if ($this->getRequest()->isXmlHttpRequest()) {
         return parent::getGridHtml();
     }
     $listing = $this->getHelper('Data\\GlobalData')->getValue('listing_for_products_category_settings');
     $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $listing]]);
     return $viewHeaderBlock->toHtml() . parent::getGridHtml();
 }
Example #6
0
 protected function _prepareLayout()
 {
     $content = $this->__('<p>This Page displays the list of the Policies you are currently using in your M2E Pro Listings. 
         Policy is a combination of settings that can be used in different M2E Pro Listings.</p><br>
         <p>You can <strong>Delete</strong> a Policy only if it\'s not being used for an M2E Pro Listing.</p>');
     $this->appendHelpBlock(['content' => $content]);
     $addButtonProps = ['id' => 'add_new_product', 'label' => __('Add Policy'), 'class' => 'add', 'button_class' => '', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\DropDown', 'options' => $this->_getAddTemplateButtonOptions()];
     $this->addButton('add', $addButtonProps);
     return parent::_prepareLayout();
 }
Example #7
0
 protected function _prepareLayout()
 {
     if ($this->getListingOtherId()) {
         $this->appendHelpBlock(['content' => $this->__('This Log contains all information about Actions, which were done on 3rd Party
                                     Listings.<br/><br/>
                                     More detailed information about ability to work with this Page you can find
                                     <a href="%url%" target="_blank">here</a>.', $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/MAAJAQ#Logs.-3rdPartyListingsLog(advancedmodeonly)'))]);
     }
     parent::_prepareLayout();
 }
Example #8
0
    protected function _toHtml()
    {
        $parentHtml = parent::_toHtml();
        $popupsHtml = $this->getPopupsHtml();
        return <<<HTML
<div id="products_progress_bar"></div>
<div id="products_container">{$parentHtml}</div>
<div style="display: none">{$popupsHtml}</div>
HTML;
    }
 protected function _toHtml()
 {
     $helpBlock = $this->createBlock('HelpBlock', '', ['data' => ['content' => $this->__('
             <p>This grid displays Synchronization results - Quantity, Price, Details (M2E Pro Listings)<br>
             Synchronization, Orders updating, Marketplaces’ data Synchronization,
             3rd Party Listings Synchronization.</p><br>
             <p>The records about Orders, Inventory and 3rd party Listings Synchronization are 
             displayed<br> only in those cases when it results in warning or error messages.</p>', $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/MAAJAQ#Logs.-SynchronizationLog'))]]);
     return $helpBlock->toHtml() . parent::_toHtml();
 }
Example #10
0
    protected function _prepareLayout()
    {
        $content = $this->__('<p>This page displays the list of M2E Pro Listings. Generally, a Listing is a group of Magento Products 
            sold on a certain Marketplace by a particular Seller and managed by the same Selling, Synchronization, 
            etc. Policy Settings.</p><br>

            <p><strong>Note:</strong> Products which are not listed via M2E Pro will be automatically added to the
            3rd Party Listings if the import option is enabled in the Account settings.</p>');
        $this->appendHelpBlock(['content' => $content]);
        return parent::_prepareLayout();
    }
Example #11
0
 protected function _beforeToHtml()
 {
     $additionalTitle = $this->getRequest()->getParam('current_indexed_xpath');
     $additionalTitle = explode('/', ltrim($additionalTitle, '/'));
     array_shift($additionalTitle);
     $additionalTitle = array_map(function ($el) {
         return preg_replace('/-\\d+/', '', $el);
     }, $additionalTitle);
     $this->setData('additional_title', implode(' > ', $additionalTitle));
     return parent::_beforeToHtml();
 }
Example #12
0
    protected function _prepareLayout()
    {
        $this->appendHelpBlock(['content' => $this->__(<<<HTML
<p>On this Page you can find information about eBay Accounts which can be managed via M2E Pro.</p><br>
<p>Settings for such configurations as eBay Orders along with Magento Order creation conditions,
3rd Party Listings import including options of Mapping them to Magento Products and Moving them to M2E Pro Listings,
etc. can be specified for each Account separately.</p><br>
<p><strong>Note:</strong> eBay Account can be deleted only if it is not being used for any of M2E Pro Listings.</p><br>
<p>More detailed information you can find <a href="%url%" target="_blank">here</a>.</p>
HTML
, $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/4gEtAQ'))]);
        return parent::_prepareLayout();
    }
Example #13
0
 protected function _toHtml()
 {
     $marketplaceFilterBlock = $this->createBlock('Marketplace\\Switcher')->setData(['component_mode' => \Ess\M2ePro\Helper\View\Ebay::NICK, 'controller_name' => $this->getRequest()->getControllerName()]);
     $marketplaceFilterBlock->setUseConfirm(false);
     $accountFilterBlock = $this->createBlock('Account\\Switcher')->setData(['component_mode' => \Ess\M2ePro\Helper\View\Ebay::NICK, 'controller_name' => $this->getRequest()->getControllerName()]);
     $accountFilterBlock->setUseConfirm(false);
     $searchFilterBlockHtml = '';
     if ($this->getHelper('View\\Ebay')->is3rdPartyShouldBeShown()) {
         $searchFilterBlock = $this->createBlock('Listing\\Search\\Switcher')->setData(['controller_name' => $this->getRequest()->getControllerName()]);
         $searchFilterBlock->setUseConfirm(false);
         $searchFilterBlockHtml = $searchFilterBlock->toHtml();
     }
     return '<div class="page-main-actions"><div class="filter_block">' . $marketplaceFilterBlock->toHtml() . $accountFilterBlock->toHtml() . $searchFilterBlockHtml . '</div></div>' . parent::_toHtml();
 }
Example #14
0
 protected function _toHtml()
 {
     $componentNick = $this->getHelper('Data\\GlobalData')->getValue('component_nick');
     $marketplaceFilterBlock = $this->createBlock('Marketplace\\Switcher')->setData(['component_mode' => $componentNick, 'controller_name' => $this->getRequest()->getControllerName()]);
     $marketplaceFilterBlock->setUseConfirm(false);
     $accountFilterBlock = $this->createBlock('Account\\Switcher')->setData(['component_mode' => $componentNick, 'controller_name' => $this->getRequest()->getControllerName()]);
     $accountFilterBlock->setUseConfirm(false);
     $pageActionsHtml = '';
     $marketplaceFilterHtml = $marketplaceFilterBlock->toHtml();
     $accountFilterHtml = $accountFilterBlock->toHtml();
     if (trim($marketplaceFilterHtml) || trim($accountFilterHtml)) {
         $pageActionsHtml = '<div class="page-main-actions"><div class="filter_block">' . $marketplaceFilterBlock->toHtml() . $accountFilterBlock->toHtml() . '</div></div>';
     }
     return $pageActionsHtml . parent::_toHtml();
 }
Example #15
0
 protected function _prepareLayout()
 {
     $content = $this->__('<p>This page displays the list of M2E Pro Listings. Generally, a Listing is a group of Magento Products
         sold on a certain Marketplace by a particular Seller and managed by the same Selling, Synchronization, etc.
         Policy Settings.</p><br>
         <p>Each Magento Product can be placed only once in each M2E Pro Listing.</p><br>
         <p><strong>Note:</strong> Products which are not listed via M2E Pro will be automatically added to the 
         3rd Party Listings if the import option is enabled in the Account settings.</p>');
     $this->appendHelpBlock(['content' => $content]);
     // ---------------------------------------
     $url = $this->getUrl('*/ebay_listing_create/index', array('step' => 1, 'clear' => 1));
     $this->addButton('add', array('label' => $this->__('Add Listing'), 'onclick' => 'setLocation(\'' . $url . '\')', 'class' => 'action-primary', 'button_class' => ''));
     // ---------------------------------------
     return parent::_prepareLayout();
 }
Example #16
0
    protected function _prepareLayout()
    {
        $this->appendHelpBlock(['content' => $this->__(<<<HTML
<p>On this Page you can find information about Amazon Accounts which can be managed via M2E Pro.
M2E Pro Amazon Account is a combination of Merchant ID and a particular Marketplace.
In order to sell Items on Amazon.es, Amazon.it etc., you need to add separate M2E Pro Accounts for 
Spain and Italy Marketplaces, although you can still use the same Merchant ID. </p><br>
<p>Settings for such configurations as eBay Orders along with Magento Order creation conditions,
3rd Party Listings import including options of Mapping them to Magento Products and Moving them to M2E Pro Listings,
etc. can be specified for each Account separately.</p><br>
<p><strong>Note:</strong> Amazon Account can be deleted only if it is not being used 
for any of M2E Pro Listings.</p><br>
<p>More detailed information you can find <a href="%url%" target="_blank">here</a>.</p>
HTML
, $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/9gEtAQ'))]);
        return parent::_prepareLayout();
    }
Example #17
0
 public function _construct()
 {
     parent::_construct();
     // Initialization block
     // ---------------------------------------
     $this->setId('listingLog');
     $this->_controller = 'adminhtml_amazon_listing_log';
     // ---------------------------------------
     // Set buttons actions
     // ---------------------------------------
     $this->removeButton('back');
     $this->removeButton('reset');
     $this->removeButton('delete');
     $this->removeButton('add');
     $this->removeButton('save');
     $this->removeButton('edit');
 }
Example #18
0
 protected function _beforeToHtml()
 {
     // ---------------------------------------
     $data = array('id' => 'mapping_submit_button', 'label' => $this->__('Confirm'), 'class' => 'mapping_submit_button submit');
     $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
     $this->setChild('mapping_submit_button', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $this->setChild('mapping_grid', $this->createBlock('Listing\\Other\\Mapping\\Grid'));
     // ---------------------------------------
     // ---------------------------------------
     $helpBlock = $this->createBlock('HelpBlock')->addData(['content' => $this->__('From the list below you should select a Magento Product to which you would like the Item
              to be linked. Click on Map To This Product link to set accordance.')]);
     $this->setChild('help_block', $helpBlock);
     // ---------------------------------------
     parent::_beforeToHtml();
 }
Example #19
0
    protected function _prepareLayout()
    {
        $this->appendHelpBlock(['content' => $this->__(<<<HTML
                <p>The list below displays groups of Items combined together based on their belonging to a 
                specific Marketplace and Account. The number of the 3rd Party Listings available for each of 
                the groups is also available.</p><br>

                <p>3rd Party Listings are the Items which were placed directly on the Channel or by using a tool
                other than M2E Pro. These Items are imported according to Account settings which means the settings 
                can be managed for different Accounts separately.</p><br>

                <p>Information in this section can be used to see which Items have not been fully managed via M2E Pro
                yet. It allows mapping the imported Channel Products to the Magento Products and further moving
                them into M2E Pro Listings.</p>

HTML
)]);
        return parent::_prepareLayout();
    }
Example #20
0
    protected function _toHtml()
    {
        $block = $this->createBlock('HelpBlock')->setData(['content' => $this->__('In this Section you can find all Item Variations with possibility to search, filter,
                sort etc.<br/><br/>

                You can add eBay Catalog Identifiers for each Variation separately.
                In case the Value of eBay Catalog Identifier
                is provided here it will be used in priority over eBay Catalog Identifiers
                Settings of Description Policy.<br/><br/>

                For Bundle Products and Simple Products with Custom Options Settings for
                eBay Catalog Identifiers can be
                provided only for each Variation separately here, as Description Policy Settings cannot be applied
                for them.<br/><br/>

                <strong>Note:</strong> markers <strong>"will be added"</strong> and <strong>"will be deleted"</strong>
                mean that Variation will be Added/Removed during the next Revise Action.')]);
        return $block->toHtml() . parent::_toHtml();
    }
Example #21
0
 protected function _prepareLayout()
 {
     $content = $this->__('
         In this Section you can Create, Edit and Delete Selling Format, Shipping Override, Description and
         Synchronization Policies.<br/><br/>
         <strong>Selling Format Policies</strong> are used to work with values related
         to the offer part of the Listings, such as
         Price, Quantity and similar parameters.<br/><br/>
         <strong>Shipping Override Policies</strong> are used to specify Settings for Shipping Services,
         Locale and Shipping Cost.<br/><br/>
         <strong>Description Policies</strong> are used to provide necessary Settings
         for Creating new ASIN/ISBN in Amazon Catalog
         or Update the Product Information of the existing Amazon Item.<br/><br/>
         In the <strong>Synchronization Policy</strong> you can set the Rules
         under which the dynamic data Synchronization between
         Channel and Magento will be performed.
     ');
     $this->appendHelpBlock(['content' => $content]);
     $addButtonProps = ['id' => 'add_new_product', 'label' => __('Add Policy'), 'class' => 'add', 'button_class' => '', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\DropDown', 'options' => $this->_getAddTemplateButtonOptions()];
     $this->addButton('add', $addButtonProps);
     return parent::_prepareLayout();
 }
Example #22
0
 protected function _toHtml()
 {
     return '<div id="add_products_progress_bar"></div>' . '<div id="add_products_container">' . parent::_toHtml() . '</div>';
 }
Example #23
0
    protected function _toHtml()
    {
        /** @var $helper \Ess\M2ePro\Helper\Data */
        $helper = $this->getHelper('Data');
        $component = \Ess\M2ePro\Helper\Component\Ebay::NICK;
        $logViewUrl = $this->getUrl('*/ebay_listing_other_log/index', array('back' => $helper->makeBackUrlParam('*/listing_other/index')));
        $someProductsWereNotMappedMessage = 'No matches were found. Please change the Mapping Attributes in <strong>';
        $someProductsWereNotMappedMessage .= 'Configuration > Account > 3rd Party Listings</strong> ';
        $someProductsWereNotMappedMessage .= 'or try to map manually.';
        $someProductsWereNotMappedMessage = $helper->escapeJs($this->__($someProductsWereNotMappedMessage));
        // M2ePro_TRANSLATIONS
        // "%task_title%" Task has completed with warnings. <a target="_blank" href="%url%">View Log</a> for details.
        $temp = '"%task_title%" Task has completed with warnings. ';
        $temp .= '<a target="_blank" href="%url%">View Log</a> for details.';
        $taskCompletedWarningMessage = $this->__($temp);
        // M2ePro_TRANSLATIONS
        // "%task_title%" Task has completed with errors. <a target="_blank" href="%url%">View Log</a> for details.
        $temp = '"%task_title%" Task has completed with errors. ';
        $temp .= '<a target="_blank" href="%url%">View Log</a> for details.';
        $taskCompletedErrorMessage = $this->__($temp);
        $this->jsUrl->addUrls($helper->getControllerActions('Listing\\Other'));
        $this->jsUrl->addUrls(['ebay_listing_other_log/index' => $this->getUrl('*/ebay_listing_other_log/index'), 'listing_other_mapping/map' => $this->getUrl('*/listing_other_mapping/map'), 'logViewUrl' => $logViewUrl, 'getErrorsSummary' => $this->getUrl('*/listing_other/getErrorsSummary'), 'runReviseProducts' => $this->getUrl('*/ebay_listing_other/runReviseProducts'), 'runRelistProducts' => $this->getUrl('*/ebay_listing_other/runRelistProducts'), 'runStopProducts' => $this->getUrl('*/ebay_listing_other/runStopProducts'), 'mapAutoToProduct' => $this->getUrl('*/listing_other_mapping/autoMap'), 'prepareData' => $this->getUrl('*/listing_other_moving/prepareMoveToListing'), 'moveToListingGridHtml' => $this->getUrl('*/ebay_listing_other_moving/moveToListingGrid'), 'getFailedProductsGridHtml' => $this->getUrl('*/listing_other_moving/getFailedProductsGrid'), 'tryToMoveToListing' => $this->getUrl('*/listing_other_moving/tryToMoveToListing'), 'moveToListing' => $this->getUrl('*/listing_other_moving/moveToListing'), 'removingProducts' => $this->getUrl('*/ebay_listing_other/removing'), 'unmappingProducts' => $this->getUrl('*/listing_other_mapping/unmapping')]);
        $this->jsTranslator->addTranslations(['Map Item "%product_title%" with Magento Product' => $this->__('Map Item "%product_title%" with Magento Product'), 'Product does not exist.' => $this->__('Product does not exist.'), 'Please enter correct Product ID.' => $this->__('Please enter correct Product ID.'), 'Product(s) was successfully Mapped.' => $this->__('Product(s) was successfully Mapped.'), 'Please enter correct Product ID or SKU' => $this->__('Please enter correct Product ID or SKU'), 'failed_mapped' => $someProductsWereNotMappedMessage, 'successfully_mapped' => $this->__('Product was successfully Mapped.'), 'mapping_product_title' => $this->__('Mapping Product'), 'product_does_not_exist' => $this->__('Product does not exist.'), 'select_simple_product' => $this->__('Current eBay version only supports Simple Products in Mapping. Please, choose Simple Product.'), 'invalid_data' => $this->__('Please enter correct Product ID.'), 'enter_product_or_sku' => $this->__('Please enter correct Product ID or SKU'), 'automap_progress_title' => $this->__('Map Item(s) to Products'), 'processing_data_message' => $this->__('Processing %product_title% Product(s).'), 'popup_title' => $this->__('Moving eBay Items'), 'popup_title_single' => $this->__('Move Item "%product_title%" to the M2E Pro Listing'), 'failed_products_popup_title' => $this->__('Product(s) failed to move'), 'successfully_moved' => $this->__('Product(s) was successfully Moved.'), 'products_were_not_moved' => $this->__('Products were not Moved. <a target="_blank" href="%url%">View Log</a> for details.', $logViewUrl), 'some_products_were_not_moved' => $this->__('Some of the Products were not Moved. <a target="_blank" href="%url%">View Log</a> for details.', $logViewUrl), 'not_enough_data' => $this->__('Not enough data.'), 'successfully_unmapped' => $this->__('Product(s) was successfully Unmapped.'), 'successfully_removed' => $this->__('Product(s) was successfully Removed.'), 'task_completed_message' => $this->__('Task completed. Please wait ...'), 'task_completed_success_message' => $this->__('"%task_title%" Task has successfully completed.'), 'task_completed_warning_message' => $taskCompletedWarningMessage, 'task_completed_error_message' => $taskCompletedErrorMessage, 'sending_data_message' => $this->__('Sending %product_title% Product(s) data on eBay.'), 'view_all_product_log_message' => $this->__('View Full Product Log.'), 'listing_locked_message' => $this->__('The Listing was locked by another process. Please try again later.'), 'listing_empty_message' => $this->__('Listing is empty.'), 'listing_all_items_message' => $this->__('Listing All Items On eBay'), 'listing_selected_items_message' => $this->__('Listing Selected Items On eBay'), 'revising_selected_items_message' => $this->__('Revising Selected Items On eBay'), 'relisting_selected_items_message' => $this->__('Relisting Selected Items On eBay'), 'stopping_selected_items_message' => $this->__('Stopping Selected Items On eBay'), 'stopping_and_removing_selected_items_message' => $this->__('Stopping On eBay And Removing From Listing Selected Items'), 'select_items_message' => $this->__('Please select the Products you want to perform the Action on.'), 'select_action_message' => $this->__('Please select Action.'), 'select_only_mapped_products' => $this->__('Only Mapped Products must be selected.'), 'select_the_same_type_products' => $this->__('Selected Items must belong to the same Account and Site.')]);
        $this->js->addRequireJs(['jQuery' => 'jquery', 'p' => 'M2ePro/Plugin/ProgressBar', 'a' => 'M2ePro/Plugin/AreaWrapper', 'lm' => 'M2ePro/Listing/Moving', 'lom' => 'M2ePro/Listing/Other/Mapping', 'loa' => 'M2ePro/Listing/Other/AutoMapping', 'lor' => 'M2ePro/Listing/Other/Removing', 'lou' => 'M2ePro/Listing/Other/Unmapping', 'elog' => 'M2ePro/Ebay/Listing/Other/Grid', 'eloa' => 'M2ePro/Ebay/Listing/Other/Action'], <<<JS

        M2ePro.customData.componentMode = '{$component}';
        M2ePro.customData.gridId = 'ebayListingOtherGrid';

        window.ListingProgressBarObj = new ProgressBar('listing_other_progress_bar');
        window.GridWrapperObj = new AreaWrapper('listing_other_content_container');

        window.EbayListingOtherGridObj = new EbayListingOtherGrid('ebayListingOtherViewGrid');
        window.EbayListingOtherMappingObj = new ListingOtherMapping(EbayListingOtherGridObj,'ebay');

        EbayListingOtherGridObj.movingHandler.setOptions(M2ePro);
        EbayListingOtherGridObj.actionHandler.setOptions(M2ePro);
        EbayListingOtherGridObj.autoMappingHandler.setOptions(M2ePro);
        EbayListingOtherGridObj.removingHandler.setOptions(M2ePro);
        EbayListingOtherGridObj.unmappingHandler.setOptions(M2ePro);

        jQuery(function() {
            EbayListingOtherGridObj.afterInitPage();
        });
JS
);
        $mapToProductBlock = $this->createBlock('Listing\\Other\\Mapping');
        return $mapToProductBlock->toHtml() . '<div id="listing_other_progress_bar"></div>' . '<div id="listing_container_errors_summary" class="errors_summary" style="display: none;"></div>' . '<div id="listing_other_content_container">' . parent::_toHtml() . '</div>';
    }
Example #24
0
    public function getGridHtml()
    {
        if ($this->getRequest()->isXmlHttpRequest()) {
            return parent::getGridHtml();
        }
        $html = '';
        // TODO NOT SUPPORTED FEATURES "Listing header selector"
        // ---------------------------------------
        $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $this->listing]]);
        $viewHeaderBlock->setListingViewMode(true);
        // ---------------------------------------
        /** @var $helper \Ess\M2ePro\Helper\Data */
        $helper = $this->getHelper('Data');
        // ---------------------------------------
        // TODO NOT SUPPORTED FEATURES
        $this->jsUrl->addUrls(array_merge(array(), $helper->getControllerActions('Ebay\\Listing', array('_current' => true)), $helper->getControllerActions('Ebay\\Listing\\AutoAction', array('id' => $this->getRequest()->getParam('id'))), array('variationProductManage' => $this->getUrl('*/ebay_listing_variation_product_manage/index'))));
        // ---------------------------------------
        // ---------------------------------------
        $this->jsTranslator->addTranslations(array('Remove Category' => $this->__('Remove Category'), 'Add New Group' => $this->__('Add New Group'), 'Add/Edit Categories Rule' => $this->__('Add/Edit Categories Rule'), '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.'), 'Compatibility Attribute' => $this->__('Compatibility Attribute'), 'Sell on Another Marketplace' => $this->__('Sell on Another Marketplace'), 'Product' => $this->__('Product'), 'Translation Service' => $this->__('Translation Service'), 'You must select at least 1 Listing.' => $this->__('You must select at least 1 Listing.'), 'Data migration.' => $this->__('Data migration...'), 'Creating Policies in process. Please wait...' => $this->__('Creating Policies in process. Please wait...'), 'Creating Translation Account in process. Please wait...' => $this->__('Creating Translation Account in process. Please wait...'), 'Creating Listing in process. Please wait...' => $this->__('Creating Listing in process. Please wait...'), 'Adding Products in process. Please wait...' => $this->__('Adding Products in process. Please wait...'), 'Products failed to add' => $this->__('Failed Products'), 'Migration success.' => $this->__('The Products have been successfully added into Destination Listing.'), 'Migration error.' => $this->__('The Products have not been added into Destination Listing' . ' because Products with the same Magento Product IDs already exist there.'), 'Some Products Categories Settings are not set or Attributes for Title or Description are empty.' => $this->__('Some Products Categories Settings are not set' . ' or Attributes for Title or Description are empty.'), 'Another Synchronization Is Already Running.' => $this->__('Another Synchronization Is Already Running.'), 'Getting information. Please wait ...' => $this->__('Getting information. Please wait ...'), 'Preparing to start. Please wait ...' => $this->__('Preparing to start. Please wait ...'), 'Synchronization has successfully ended.' => $this->__('Synchronization has successfully ended.'), 'Synchronization ended with warnings. <a target="_blank" href="%url%">View Log</a> for details.' => $this->__('Synchronization ended with warnings. <a target="_blank" href="%url%">View Log</a> for details.'), 'Synchronization ended with errors. <a target="_blank" href="%url%">View Log</a> for details.' => $this->__('Synchronization ended with errors. <a target="_blank" href="%url%">View Log</a> for details.')));
        // ---------------------------------------
        if (!$this->getRequest()->isXmlHttpRequest()) {
            $this->js->add(<<<JS
    define('EbayListingAutoActionInstantiation', [
        'M2ePro/Ebay/Listing/AutoAction',
        'extjs/ext-tree-checkbox'
    ], function(){

        window.ListingAutoActionObj = new EbayListingAutoAction();

    });
JS
);
        }
        // ---------------------------------------
        return $viewHeaderBlock->toHtml() . parent::getGridHtml();
    }
Example #25
0
    protected function _toHtml()
    {
        $componentMode = \Ess\M2ePro\Helper\Component\Amazon::NICK;
        $this->jsUrl->addUrls(['amazon_listing_other_log/index' => $this->getUrl('*/amazon_listing_other_log/index', array('back' => $this->getHelper('Data')->makeBackUrlParam('*/amazon_listing_other/index'))), 'listing_other_mapping/map' => $this->getUrl('*/listing_other_mapping/map'), 'prepareData' => $this->getUrl('*/listing_other_moving/prepareMoveToListing'), 'createDefaultListing' => $this->getUrl('*/listing_other_moving/createDefaultListing'), 'moveToListingGridHtml' => $this->getUrl('*/listing_other_moving/moveToListingGrid'), 'getFailedProductsGridHtml' => $this->getUrl('*/listing_other_moving/getFailedProductsGrid'), 'tryToMoveToListing' => $this->getUrl('*/listing_other_moving/tryToMoveToListing'), 'moveToListing' => $this->getUrl('*/listing_other_moving/moveToListing'), 'mapAutoToProduct' => $this->getUrl('*/listing_other_mapping/autoMap'), 'removingProducts' => $this->getUrl('*/amazon_listing_other/removing'), 'unmappingProducts' => $this->getUrl('*/listing_other_mapping/unmapping'), 'amazon_listing/getAFNQtyBySku' => $this->getUrl('*/amazon_listing/getAFNQtyBySku')]);
        $someProductsWereNotMappedMessage = 'No matches were found. Please change the Mapping Attributes in <strong>';
        $someProductsWereNotMappedMessage .= 'Configuration > Account > 3rd Party Listings</strong> ';
        $someProductsWereNotMappedMessage .= 'or try to map manually.';
        $someProductsWereNotMappedMessage = $this->__($someProductsWereNotMappedMessage);
        $createListing = $this->__('Listings, which have the same Marketplace and Account were not found.');
        $createListing .= $this->__('Would you like to create one with Default Settings ?');
        $this->jsTranslator->addTranslations(['Map Item "%product_title%" with Magento Product' => $this->__('Map Item "%product_title%" with Magento Product'), 'Product does not exist.' => $this->__('Product does not exist.'), 'Please enter correct Product ID.' => $this->__('Please enter correct Product ID.'), 'Product(s) was successfully Mapped.' => $this->__('Product(s) was successfully Mapped.'), 'Please enter correct Product ID or SKU' => $this->__('Please enter correct Product ID or SKU'), 'Current version only supports Simple Products. Please, choose Simple Product.' => $this->__('Current version only supports Simple Products. Please, choose Simple Product.'), 'Item was not Mapped as the chosen %product_id% Simple Product has Custom Options.' => $this->__('Item was not Mapped as the chosen %product_id% Simple Product has Custom Options.'), 'create_listing' => $createListing, 'popup_title' => $this->__('Moving Amazon Items'), 'popup_title_single' => $this->__('Move Item "%product_title%" to the M2E Pro Listing'), 'failed_products_popup_title' => $this->__('Products failed to move'), 'confirm' => $this->__('Are you sure?'), 'successfully_moved' => $this->__('Product(s) was successfully Moved.'), 'products_were_not_moved' => $this->__('Products were not Moved. <a target="_blank" href="%url%">View Log</a> for details.'), 'some_products_were_not_moved' => $this->__('Some of the Products were not Moved. <a target="_blank" href="%url%">View Log</a> for details.'), 'not_enough_data' => $this->__('Not enough data'), 'successfully_unmapped' => $this->__('Product(s) was successfully Unmapped.'), 'successfully_removed' => $this->__('Product(s) was successfully Removed.'), 'select_items_message' => $this->__('Please select the Products you want to perform the Action on.'), 'select_action_message' => $this->__('Please select Action.'), 'automap_progress_title' => $this->__('Map Item(s) to Products'), 'processing_data_message' => $this->__('Processing %product_title% Product(s).'), 'successfully_mapped' => $this->__('Product was successfully Mapped.'), 'failed_mapped' => $someProductsWereNotMappedMessage, 'select_only_mapped_products' => $this->__('Only Mapped Products must be selected.'), 'select_the_same_type_products' => $this->__('Selected Items must belong to the same Account and Marketplace.'), 'view_all_product_log_message' => $this->__('View Full Product Log.'), 'success_word' => $this->__('Success'), 'notice_word' => $this->__('Notice'), 'warning_word' => $this->__('Warning'), 'error_word' => $this->__('Error'), 'close_word' => $this->__('Close'), 'task_completed_message' => $this->__('Task completed. Please wait ...')]);
        $this->js->addRequireJs(['jQuery' => 'jquery', 'p' => 'M2ePro/Plugin/ProgressBar', 'a' => 'M2ePro/Plugin/AreaWrapper', 'lm' => 'M2ePro/Listing/Moving', 'lom' => 'M2ePro/Listing/Other/Mapping', 'loa' => 'M2ePro/Listing/Other/AutoMapping', 'lor' => 'M2ePro/Listing/Other/Removing', 'lou' => 'M2ePro/Listing/Other/Unmapping', 'elog' => 'M2ePro/Amazon/Listing/Other/Grid', 'eloa' => 'M2ePro/Amazon/Listing/AfnQty'], <<<JS

        M2ePro.customData.componentMode = '{$componentMode}';
        M2ePro.customData.gridId = 'amazonListingOtherGrid';

        window.ListingProgressBarObj = new ProgressBar('listing_other_progress_bar');
        window.GridWrapperObj = new AreaWrapper('listing_other_content_container');

        window.AmazonListingOtherGridObj    = new AmazonListingOtherGrid('amazonListingOtherGrid');
        window.AmazonListingOtherMappingObj = new ListingOtherMapping(AmazonListingOtherGridObj, 'amazon');

        AmazonListingOtherGridObj.movingHandler.setOptions(M2ePro);
        AmazonListingOtherGridObj.autoMappingHandler.setOptions(M2ePro);
        AmazonListingOtherGridObj.removingHandler.setOptions(M2ePro);
        AmazonListingOtherGridObj.unmappingHandler.setOptions(M2ePro);

        window.AmazonListingAfnQtyObj = new AmazonListingAfnQty();

        jQuery(function() {
            AmazonListingOtherGridObj.afterInitPage();
        });
JS
);
        return '<div id="listing_other_progress_bar"></div>' . '<div id="listing_container_errors_summary" class="errors_summary" style="display: none;"></div>' . '<div id="listing_other_content_container">' . parent::_toHtml() . '</div>';
    }
Example #26
0
    public function getGridHtml()
    {
        if ($this->getRequest()->isXmlHttpRequest()) {
            return parent::getGridHtml();
        }
        $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Model\\Listing'));
        $showAutoAction = json_encode((bool) $this->getRequest()->getParam('auto_actions'));
        // ---------------------------------------
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\AutoAction', array('id' => $this->getRequest()->getParam('id'))));
        $path = 'amazon_listing_product_log/index';
        $this->jsUrl->add($this->getUrl('*/' . $path, array('back' => $this->getHelper('Data')->makeBackUrlParam('*/amazon_listing/view', array('id' => $this->listing['id'])))), $path);
        $path = 'amazon_listing/duplicateProducts';
        $this->jsUrl->add($this->getUrl('*/' . $path), $path);
        $this->jsUrl->add($this->getUrl('*/amazon_listing_log/index', array('id' => $this->listing['id'], 'back' => $this->getHelper('Data')->makeBackUrlParam('*/amazon_listing/view', ['id' => $this->listing['id']]))), 'logViewUrl');
        $this->jsUrl->add($this->getUrl('*/listing/getErrorsSummary'), 'getErrorsSummary');
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing'));
        $this->jsUrl->addUrls(['runListProducts' => $this->getUrl('*/amazon_listing/runListProducts'), 'runRelistProducts' => $this->getUrl('*/amazon_listing/runRelistProducts'), 'runReviseProducts' => $this->getUrl('*/amazon_listing/runReviseProducts'), 'runStopProducts' => $this->getUrl('*/amazon_listing/runStopProducts'), 'runStopAndRemoveProducts' => $this->getUrl('*/amazon_listing/runStopAndRemoveProducts'), 'runDeleteAndRemoveProducts' => $this->getUrl('*/amazon_listing/runDeleteAndRemoveProducts'), 'runRemoveProducts' => $this->getUrl('*/amazon_listing/runRemoveProducts')]);
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Fulfillment'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Search'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Template\\Description'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Variation'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Variation\\Manage'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Variation\\Individual'));
        $this->jsUrl->add($this->getUrl('*/amazon_listing_view_settings_moving/moveToListingGrid', ['listing_view' => true]), 'moveToListingGridHtml');
        $this->jsUrl->add($this->getUrl('*/listing_moving/prepareMoveToListing'), 'prepareData');
        $this->jsUrl->add($this->getUrl('*/listing_moving/getFailedProductsGrid'), 'getFailedProductsGridHtml');
        $this->jsUrl->add($this->getUrl('*/listing_moving/tryToMoveToListing'), 'tryToMoveToListing');
        $this->jsUrl->add($this->getUrl('*/listing_moving/moveToListing'), 'moveToListing');
        $this->jsUrl->add($this->getUrl('*/amazon_marketplace/index'), 'marketplaceSynchUrl');
        $this->jsUrl->add($this->getUrl('*/listing/saveListingAdditionalData', ['id' => $this->listing['id']]), 'saveListingAdditionalData');
        //        TODO
        //        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions(
        //            'amazon_listing_repricing',
        //            array(
        //                'id' => $this->listing['id'],
        //                'account_id' => $this->listing['account_id']
        //            )
        //        ));
        // ---------------------------------------
        $component = \Ess\M2ePro\Helper\Component\Amazon::NICK;
        $gridId = $this->getChildBlock('grid')->getId();
        $ignoreListings = json_encode(array($this->listing['id']));
        $marketplace = json_encode(array_merge($this->listing->getMarketplace()->getData(), $this->listing->getMarketplace()->getChildObject()->getData()));
        $isNewAsinAvailable = json_encode($this->listing->getMarketplace()->getChildObject()->isNewAsinAvailable());
        $temp = $this->getHelper('Data\\Session')->getValue('products_ids_for_list', true);
        $productsIdsForList = empty($temp) ? '' : $temp;
        //        TODO
        //        $getUpdatedRepricingPriceBySkus = $this->getUrl(
        //            '*/amazon_listing_repricing/getUpdatedPriceBySkus'
        //        );
        $templateDescriptionPopupTitle = $this->__('Assign Description Policy');
        $popupTitle = $this->__('Moving Amazon Items');
        $popupTitleSingle = $this->__('Moving Amazon Item');
        $failedProductsPopupTitle = $this->__('Products failed to move');
        $taskCompletedMessage = $this->__('Task completed. Please wait ...');
        $taskCompletedSuccessMessage = $this->__('"%task_title%" Task has successfully submitted to be processed.');
        $taskCompletedWarningMessage = $this->__('"%task_title%" Task has completed with warnings. <a target="_blank" href="%url%">View Log</a> for details.');
        $taskCompletedErrorMessage = $this->__('"%task_title%" Task has completed with errors. <a target="_blank" href="%url%">View Log</a> for details.');
        $lockedObjNoticeMessage = $this->__('Some Amazon request(s) are being processed now.');
        $sendingDataToAmazonMessage = $this->__('Sending %product_title% Product(s) data on Amazon.');
        $viewAllProductLogMessage = $this->__('View Full Product Log');
        $listingLockedMessage = $this->__('The Listing was locked by another process. Please try again later.');
        $listingEmptyMessage = $this->__('Listing is empty.');
        $listingAllItemsMessage = $this->__('Listing All Items On Amazon');
        $listingSelectedItemsMessage = $this->__('Listing Selected Items On Amazon');
        $revisingSelectedItemsMessage = $this->__('Revising Selected Items On Amazon');
        $relistingSelectedItemsMessage = $this->__('Relisting Selected Items On Amazon');
        $stoppingSelectedItemsMessage = $this->__('Stopping Selected Items On Amazon');
        $stoppingAndRemovingSelectedItemsMessage = $this->__('Stopping On Amazon And Removing From Listing Selected Items');
        $deletingAndRemovingSelectedItemsMessage = $this->__('Removing From Amazon And Listing Selected Items');
        $removingSelectedItemsMessage = $this->__('Removing From Listing Selected Items');
        $successfullyMovedMessage = $this->__('Product(s) was successfully Moved.');
        $productsWereNotMovedMessage = $this->__('Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.');
        $someProductsWereNotMovedMessage = $this->__('Some Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.');
        $selectItemsMessage = $this->__('Please select the Products you want to perform the Action on.');
        $selectActionMessage = $this->__('Please select Action.');
        $assignString = $this->__('Assign');
        $templateShippingOverridePopupTitle = $this->__('Assign Shipping Override Policy');
        $enterProductSearchQueryMessage = $this->__('Please enter Product Title or ASIN/ISBN/UPC/EAN.');
        $autoMapAsinSearchProducts = $this->__('Search %product_title% Product(s) on Amazon.');
        $autoMapAsinProgressTitle = $this->__('Automatic Assigning ASIN/ISBN to Item(s)');
        $autoMapAsinErrorMessage = $this->__('Server is currently unavailable. Please try again later.');
        $newAsinNotAvailable = $this->__('The new ASIN/ISBN creation functionality is not available in %code% Marketplace yet.');
        $notSynchronizedMarketplace = $this->__('In order to use New ASIN/ISBN functionality, please re-synchronize Marketplace data.') . ' ' . $this->__('Press "Save And Update" Button after redirect on Marketplace Page.');
        $noVariationsLeftText = $this->__('All variations are already added.');
        $notSet = $this->__('Not Set');
        $setAttributes = $this->__('Set Attributes');
        $variationManageMatchedAttributesError = $this->__('Please choose valid Attributes.');
        $variationManageMatchedAttributesErrorDuplicateSelection = $this->__('You can not choose the same Attribute twice.');
        $variationManageSkuPopUpTitle = $this->__('Enter Amazon Parent Product SKU');
        $switchToIndividualModePopUpTitle = $this->__('Change "Manage Variations" Mode');
        $switchToParentModePopUpTitle = $this->__('Change "Manage Variations" Mode');
        $emptySkuError = $this->__('Please enter Amazon Parent Product SKU.');
        $this->jsTranslator->addTranslations(['Remove Category' => $this->__('Remove Category'), 'Add New Group' => $this->__('Add New Group'), 'Add/Edit Categories Rule' => $this->__('Add/Edit Categories Rule'), '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.'), 'Clear Search Results' => $this->__('Clear Search Results'), 'popup_title' => $popupTitle, 'popup_title_single' => $popupTitleSingle, 'failed_products_popup_title' => $failedProductsPopupTitle, 'task_completed_message' => $taskCompletedMessage, 'task_completed_success_message' => $taskCompletedSuccessMessage, 'task_completed_warning_message' => $taskCompletedWarningMessage, 'task_completed_error_message' => $taskCompletedErrorMessage, 'locked_obj_notice' => $lockedObjNoticeMessage, 'sending_data_message' => $sendingDataToAmazonMessage, 'view_all_product_log_message' => $viewAllProductLogMessage, 'listing_locked_message' => $listingLockedMessage, 'listing_empty_message' => $listingEmptyMessage, 'listing_all_items_message' => $listingAllItemsMessage, 'listing_selected_items_message' => $listingSelectedItemsMessage, 'revising_selected_items_message' => $revisingSelectedItemsMessage, 'relisting_selected_items_message' => $relistingSelectedItemsMessage, 'stopping_selected_items_message' => $stoppingSelectedItemsMessage, 'stopping_and_removing_selected_items_message' => $stoppingAndRemovingSelectedItemsMessage, 'deleting_and_removing_selected_items_message' => $deletingAndRemovingSelectedItemsMessage, 'removing_selected_items_message' => $removingSelectedItemsMessage, 'successfully_moved' => $successfullyMovedMessage, 'products_were_not_moved' => $productsWereNotMovedMessage, 'some_products_were_not_moved' => $someProductsWereNotMovedMessage, 'select_items_message' => $selectItemsMessage, 'select_action_message' => $selectActionMessage, 'templateDescriptionPopupTitle' => $templateDescriptionPopupTitle, 'templateShippingOverridePopupTitle' => $templateShippingOverridePopupTitle, 'assign' => $assignString, 'enter_productSearch_query' => $enterProductSearchQueryMessage, 'automap_asin_search_products' => $autoMapAsinSearchProducts, 'automap_asin_progress_title' => $autoMapAsinProgressTitle, 'automap_error_message' => $autoMapAsinErrorMessage, 'new_asin_not_available' => $newAsinNotAvailable, 'not_synchronized_marketplace' => $notSynchronizedMarketplace, 'no_variations_left' => $noVariationsLeftText, 'not_set' => $notSet, 'set_attributes' => $setAttributes, 'variation_manage_matched_attributes_error' => $variationManageMatchedAttributesError, 'variation_manage_matched_attributes_error_duplicate' => $variationManageMatchedAttributesErrorDuplicateSelection, 'error_changing_product_options' => $this->__('Please Select Product Options.'), 'variation_manage_matched_sku_popup_title' => $variationManageSkuPopUpTitle, 'empty_sku_error' => $emptySkuError, 'switch_to_individual_mode_popup_title' => $switchToIndividualModePopUpTitle, 'switch_to_parent_mode_popup_title' => $switchToParentModePopUpTitle, 'Add New Description Policy' => $this->__('Add New Description Policy'), 'Add New Child Product' => $this->__('Add New Child Product')]);
        $this->js->addOnReadyJs(<<<JS
    require([
        'M2ePro/Amazon/Listing/View/Grid',
        'M2ePro/Amazon/Listing/AfnQty',
        'M2ePro/Amazon/Listing/AutoAction',
        'M2ePro/Amazon/Listing/Product/Variation'
    ], function(){

        M2ePro.productsIdsForList = '{$productsIdsForList}';
    
        M2ePro.customData.componentMode = '{$component}';
        M2ePro.customData.gridId = '{$gridId}';
        M2ePro.customData.ignoreListings = '{$ignoreListings}';
    
        M2ePro.customData.marketplace = {$marketplace};
        M2ePro.customData.isNewAsinAvailable = {$isNewAsinAvailable};
        
        ListingGridHandlerObj = new AmazonListingViewGrid(
            '{$gridId}',
            {$this->listing['id']}
        );
        ListingGridHandlerObj.afterInitPage();
        
        ListingGridHandlerObj.movingHandler.setOptions(M2ePro);
           
        ListingGridHandlerObj.actionHandler.setProgressBar('listing_view_progress_bar');
        ListingGridHandlerObj.actionHandler.setGridWrapper('listing_view_content_container');
            
        AmazonListingProductVariationObj = new AmazonListingProductVariation(ListingGridHandlerObj);

        if (M2ePro.productsIdsForList) {
            ListingGridHandlerObj.getGridMassActionObj().checkedString = M2ePro.productsIdsForList;
            ListingGridHandlerObj.actionHandler.listAction();
        }
    
        window.ListingAutoActionObj = new AmazonListingAutoAction();
        if ({$showAutoAction}) {
            ListingAutoActionObj.loadAutoActionHtml();
        }
    
        AmazonListingAfnQtyObj = new AmazonListingAfnQty();
        // TODO
        // CommonAmazonListingRepricingPriceHandlerObj = new CommonAmazonListingRepricingPriceHandler();
    });
JS
);
        $productSearchBlock = $this->createBlock('Amazon\\Listing\\Product\\Search\\Main');
        // TODO NOT SUPPORTED FEATURES "Listing header selector"
        //        // ---------------------------------------
        //        $listingSwitcher = $this->getLayout()->createBlock(
        //            'M2ePro/adminhtml_common_amazon_listing_view_listingSwitcher'
        //        );
        //        // ---------------------------------------
        // ---------------------------------------
        $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $this->listing]]);
        // ---------------------------------------
        //        // ---------------------------------------
        //        $switchToIndividualPopup = $this->getLayout()->createBlock(
        //            'M2ePro/adminhtml_common_amazon_listing_variation_product_switchToIndividualPopup');
        //        // ---------------------------------------
        //
        //        // ---------------------------------------
        //        $switchToParentPopup = $this->getLayout()->createBlock(
        //            'M2ePro/adminhtml_common_amazon_listing_variation_product_switchToParentPopup');
        //        // ---------------------------------------
        return $viewHeaderBlock->toHtml() . $productSearchBlock->toHtml() . parent::getGridHtml();
    }
Example #27
0
 protected function _toHtml()
 {
     return '<div id="add_products_progress_bar"></div>' . '<div id="add_products_container">' . parent::_toHtml() . '</div>' . $this->getAutoactionPopupHtml();
 }
Example #28
0
    protected function _toHtml()
    {
        $createEmptyListingMessage = $this->__('Are you sure you want to create empty Listing?');
        $taskCompletedMessage = $this->__('Task completed. Please wait ...');
        $taskCompletedSuccessMessage = $this->__('"%task_title%" Task has successfully submitted to be processed.');
        $taskCompletedWarningMessage = $this->__('"%task_title%" Task has completed with warnings. <a target="_blank" href="%url%">View Log</a> for details.');
        $taskCompletedErrorMessage = $this->__('"%task_title%" Task has completed with errors. <a target="_blank" href="%url%">View Log</a> for details.');
        $sendingDataToAmazonMessage = $this->__('Sending %product_title% Product(s) data on Amazon.');
        $selectItemsMessage = $this->__('Please select the Products you want to perform the Action on.');
        $assignString = $this->__('Assign');
        $textConfirm = $this->__('Are you sure?');
        $enterProductSearchQueryMessage = $this->__('Please enter Product Title or ASIN/ISBN/UPC/EAN.');
        $autoMapAsinSearchProducts = $this->__('Search %product_title% Product(s) on Amazon.');
        $autoMapAsinProgressTitle = $this->__('Automatic Assigning ASIN/ISBN to Item(s)');
        $autoMapAsinErrorMessage = $this->__('Server is currently unavailable. Please try again later.');
        $newAsinNotAvailable = $this->__('The new ASIN/ISBN creation functionality is not available in %code% Marketplace yet.');
        $notSynchronizedMarketplace = $this->__('In order to use New ASIN/ISBN functionality, please re-synchronize Marketplace data.') . ' ' . $this->__('Press "Save And Update" Button after redirect on Marketplace Page.');
        $newAsinPopupTitle = $this->__('New ASIN/ISBN creation');
        $notCompletedPopupTitle = $this->__('Adding of New Products to the Listing was not competed');
        $notCompletedPopupText = $this->__('
            The Process of Adding new Products was not ended for this Listing.<br/><br/>
            To work with Products in Listing it is necessary to follow all the Steps of Adding Products.
            You should specify all Required Data to complete
            Adding Process and then press <strong>Continue</strong> Button.<br/><br/>
            In case you do not want to Add selected Products to the Listing,
            you can press <strong>Back</strong> Button and you will be able to manage your Listing.
        ');
        $variationManageMatchedAttributesErrorDuplicateSelection = $this->__('You can not choose the same Attribute twice.');
        $this->jsTranslator->addTranslations(['select_items_message' => $selectItemsMessage, 'create_empty_listing_message' => $createEmptyListingMessage, 'sending_data_message' => $sendingDataToAmazonMessage, 'new_asin_not_available' => $newAsinNotAvailable, 'not_synchronized_marketplace' => $notSynchronizedMarketplace, 'enter_productSearch_query' => $enterProductSearchQueryMessage, 'automap_asin_search_products' => $autoMapAsinSearchProducts, 'automap_asin_progress_title' => $autoMapAsinProgressTitle, 'automap_error_message' => $autoMapAsinErrorMessage, 'task_completed_message' => $taskCompletedMessage, 'task_completed_success_message' => $taskCompletedSuccessMessage, 'task_completed_warning_message' => $taskCompletedWarningMessage, 'task_completed_error_message' => $taskCompletedErrorMessage, 'assign' => $assignString, 'confirm' => $textConfirm, 'new_asin_popup_title' => $newAsinPopupTitle, 'not_completed_popup_title' => $notCompletedPopupTitle, 'not_completed_popup_text' => $notCompletedPopupText, 'variation_manage_matched_attributes_error_duplicate' => $variationManageMatchedAttributesErrorDuplicateSelection, 'Clear Search Results' => $this->__('Clear Search Results')]);
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Add', ['wizard' => $this->getRequest()->getParam('wizard')]));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\Product\\Search'));
        $this->jsUrl->addUrls(['back' => $this->getUrl('*/*/index')]);
        $this->js->add(<<<JS
    require([
        'M2ePro/Plugin/ProgressBar',
        'M2ePro/Plugin/AreaWrapper'
    ],function() {
        Common.prototype.scrollPageToTop = function() { return; }

        ListingProgressBarObj = new ProgressBar('search_asin_progress_bar');
        GridWrapperObj = new AreaWrapper('search_asin_products_container');
    });
JS
);
        return '<div id="search_asin_progress_bar"></div>' . '<div id="search_asin_products_container">' . parent::_toHtml() . '</div>';
    }