Пример #1
0
 public function getAmazonTabHtml()
 {
     $tutorialShowed = Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/cache/amazon/listing/', 'tutorial_shown');
     if (!$tutorialShowed) {
         return parent::getAmazonTabHtml();
     }
     $javascript = '';
     if ($this->getRequest()->isXmlHttpRequest()) {
         $javascript = $this->getAmazonTabBlock()->getTemplatesButtonJavascript();
     }
     return $javascript . $this->getLayout()->createBlock('M2ePro/adminhtml_amazon_listing_filter')->toHtml() . parent::getAmazonTabHtml();
 }
Пример #2
0
    public function getAmazonTabHtml()
    {
        /** @var $helper Ess_M2ePro_Helper_Data */
        $helper = Mage::helper('M2ePro');
        $componentMode = Ess_M2ePro_Helper_Component_Amazon::NICK;
        $logViewUrl = $this->getUrl('*/adminhtml_log/listingOther', array('filter' => base64_encode('component_mode=' . Ess_M2ePro_Helper_Component_Amazon::NICK), 'back' => $helper->makeBackUrlParam('*/adminhtml_listingOther/index')));
        $prepareData = $this->getUrl('*/adminhtml_listingOther/prepareMoveToListing');
        $createDefaultListingUrl = $this->getUrl('*/adminhtml_listingOther/createDefaultListing');
        $getMoveToListingGridHtml = $this->getUrl('*/adminhtml_listing/moveToListingGrid');
        $getFailedProductsGridHtml = $this->getUrl('*/adminhtml_listing/getFailedProductsGrid');
        $tryToMoveToListing = $this->getUrl('*/adminhtml_amazon_listingOther/tryToMoveToListing');
        $moveToListing = $this->getUrl('*/adminhtml_amazon_listingOther/moveToListing');
        $mapToProductUrl = $this->getUrl('*/adminhtml_amazon_listingOther/mapToProduct');
        $mapAutoToProductUrl = $this->getUrl('*/adminhtml_amazon_listingOther/mapAutoToProduct');
        $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 = Mage::helper('M2ePro')->__($someProductsWereNotMappedMessage);
        $createListing = $helper->escapeJs($helper->__('Listings, which have the same Marketplace and Account were not found.'));
        $createListing .= $helper->escapeJs($helper->__('Would you like to create one with default settings ?'));
        $popupTitle = $helper->escapeJs($helper->__('Moving Amazon Items.'));
        $failedProductsPopupTitle = $helper->escapeJs($helper->__('Products failed to move'));
        $confirmMessage = $helper->escapeJs($helper->__('Are you sure?'));
        $successfullyMovedMessage = $helper->escapeJs($helper->__('Product(s) was successfully moved.'));
        $productsWereNotMovedMessage = $helper->escapeJs($helper->__('Products were not moved. <a href="%s">View log</a> for details.'));
        $someProductsWereNotMovedMessage = $helper->escapeJs($helper->__('Some of the products were not moved. <a href="%s">View log</a> for details.'));
        $viewAllProductLogMessage = $helper->escapeJs($helper->__('View All Product Log.'));
        $selectItemsMessage = $helper->escapeJs($helper->__('Please select items.'));
        $selectActionMessage = $helper->escapeJs($helper->__('Please select action.'));
        $processingDataMessage = $helper->escapeJs($helper->__('Processing %s product(s).'));
        $successfullyMappedMessage = $helper->escapeJs($helper->__('Product(s) was successfully mapped.'));
        $mappingProductMessage = $helper->escapeJs($helper->__('Mapping Product'));
        $productDoesNotExistMessage = $helper->escapeJs($helper->__('Product does not exist.'));
        // ->__('Item was not mapped as the chosen %s Simple Product has Custom Options.')
        $tempSelectWithOutOptions = 'Item was not mapped as the chosen %s Simple Product has Custom Options.' . ' ';
        $tempSelectWithOutOptions = Mage::helper('M2ePro')->__($tempSelectWithOutOptions);
        // ->__('Please, choose another Simple Product.')
        $temp2SelectWithOutOptions = 'Please, choose another Simple Product.';
        $temp2SelectWithOutOptions = Mage::helper('M2ePro')->__($temp2SelectWithOutOptions);
        $selectWithOutOptions = $tempSelectWithOutOptions . $temp2SelectWithOutOptions;
        // ->__('Current Amazon version only supports simple products. Please, choose simple product.')
        $temp = 'Current Amazon version only supports simple products. Please, choose simple product.';
        $selectSimpleProductMessage = $helper->escapeJs($helper->__($temp));
        $invalidDataMessage = $helper->escapeJs($helper->__('Please enter correct product ID.'));
        $enterProductOrSkuMessage = $helper->escapeJs($helper->__('Please enter correct product ID or SKU'));
        $autoMapProgressTitle = $helper->escapeJs($helper->__('Map Item(s) to Products'));
        $selectOnlyMapped = $helper->escapeJs($helper->__('Only mapped products must be selected.'));
        $selectTheSameTypeProducts = $helper->escapeJs($helper->__('Selected items must belong to the same Account and Marketplace.'));
        $successWord = $helper->escapeJs($helper->__('Success'));
        $noticeWord = $helper->escapeJs($helper->__('Notice'));
        $warningWord = $helper->escapeJs($helper->__('Warning'));
        $errorWord = $helper->escapeJs($helper->__('Error'));
        $closeWord = $helper->escapeJs($helper->__('Close'));
        $javascriptsMain = <<<JAVASCRIPT
<script type="text/javascript">

    M2eProAmazon = {};
    M2eProAmazon.url = {};
    M2eProAmazon.formData = {};
    M2eProAmazon.customData = {};
    M2eProAmazon.text = {};

    M2eProAmazon.url.logViewUrl = '{$logViewUrl}';
    M2eProAmazon.url.prepareData = '{$prepareData}';
    M2eProAmazon.url.createDefaultListing = '{$createDefaultListingUrl}';
    M2eProAmazon.url.getGridHtml = '{$getMoveToListingGridHtml}';
    M2eProAmazon.url.getFailedProductsGridHtml = '{$getFailedProductsGridHtml}';
    M2eProAmazon.url.tryToMoveToListing = '{$tryToMoveToListing}';
    M2eProAmazon.url.moveToListing = '{$moveToListing}';
    M2eProAmazon.url.mapToProduct = '{$mapToProductUrl}';
    M2eProAmazon.url.mapAutoToProductUrl = '{$mapAutoToProductUrl}';

    M2eProAmazon.text.create_listing = '{$createListing}';
    M2eProAmazon.text.popup_title = '{$popupTitle}';
    M2eProAmazon.text.failed_products_popup_title = '{$failedProductsPopupTitle}';
    M2eProAmazon.text.confirm = '{$confirmMessage}';
    M2eProAmazon.text.successfully_moved = '{$successfullyMovedMessage}';
    M2eProAmazon.text.products_were_not_moved = '{$productsWereNotMovedMessage}';
    M2eProAmazon.text.some_products_were_not_moved = '{$someProductsWereNotMovedMessage}';

    M2eProAmazon.text.select_items_message = '{$selectItemsMessage}';
    M2eProAmazon.text.select_action_message = '{$selectActionMessage}';

    M2eProAmazon.text.successfully_mapped = '{$successfullyMappedMessage}';
    M2eProAmazon.text.mapping_product_title = '{$mappingProductMessage}';
    M2eProAmazon.text.product_does_not_exist = '{$productDoesNotExistMessage}';
    M2eProAmazon.text.select_simple_product = '{$selectSimpleProductMessage}';
    M2eProAmazon.text.invalid_data = '{$invalidDataMessage}';
    M2eProAmazon.text.enter_product_or_sku = '{$enterProductOrSkuMessage}';
    M2eProAmazon.text.automap_progress_title = '{$autoMapProgressTitle}';
    M2eProAmazon.text.processing_data_message = '{$processingDataMessage}';
    M2eProAmazon.text.select_without_options = '{$selectWithOutOptions}';
    M2eProAmazon.text.failed_mapped = '{$someProductsWereNotMappedMessage}';

    M2eProAmazon.text.select_only_mapped_products = '{$selectOnlyMapped}';
    M2eProAmazon.text.select_the_same_type_products = '{$selectTheSameTypeProducts}';

    M2eProAmazon.text.view_all_product_log_message = '{$viewAllProductLogMessage}';

    M2eProAmazon.text.success_word = '{$successWord}';
    M2eProAmazon.text.notice_word = '{$noticeWord}';
    M2eProAmazon.text.warning_word = '{$warningWord}';
    M2eProAmazon.text.error_word = '{$errorWord}';
    M2eProAmazon.text.close_word = '{$closeWord}';

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

    var init = function () {
        AmazonListingOtherMapToProductHandlerObj = new ListingOtherMapToProductHandler(M2eProAmazon);
        AmazonListingActionHandlerObj = new ListingActionHandler(M2eProAmazon);
        AmazonListingMoveToListingHandlerObj = new ListingMoveToListingHandler(M2eProAmazon);
        AmazonListingOtherAutoMapHandlerObj = new ListingOtherAutoMapHandler(M2eProAmazon);
        AmazonListingItemGridHandlerObj = new ListingItemGridHandler( M2eProAmazon,
                                                                      'amazonListingOtherGrid',
                                                                      3,
                                                                      2,
                                                                      AmazonListingActionHandlerObj,
                                                                      AmazonListingMoveToListingHandlerObj,
                                                                      undefined,
                                                                      AmazonListingOtherAutoMapHandlerObj );
    }

    {$this->isAjax} ? init()
                    : Event.observe(window, 'load', init);

</script>
JAVASCRIPT;
        $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_amazon_listing_other_help');
        $javascriptsMain .= $this->getHelpBlockJavascript($helpBlock->getContainerId());
        return $javascriptsMain . $helpBlock->toHtml() . $this->getAmazonTabBlockFilterHtml() . parent::getAmazonTabHtml();
    }
Пример #3
0
 public function getAmazonTabHtml()
 {
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_amazon_synchronization_help');
     return $helpBlock->toHtml() . parent::getAmazonTabHtml();
 }
Пример #4
0
 public function getAmazonTabHtml()
 {
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_amazon_order_help');
     $javascript = $this->getHelpBlockJavascript($helpBlock->getContainerId());
     return $javascript . $helpBlock->toHtml() . $this->getAmazonTabBlockFilterHtml() . parent::getAmazonTabHtml();
 }