Esempio n. 1
0
 protected function _construct()
 {
     parent::_construct();
     $this->_controller = 'adminhtml_ebay_account';
     // Set buttons actions
     // ---------------------------------------
     $this->removeButton('back');
     $this->removeButton('reset');
     $this->removeButton('delete');
     $this->removeButton('add');
     $this->removeButton('save');
     $this->removeButton('edit');
     if ((bool) $this->getRequest()->getParam('close_on_save', false)) {
         if ($this->getRequest()->getParam('id')) {
             $this->addButton('save', array('label' => $this->__('Save And Close'), 'onclick' => 'EbayAccountObj.saveAndClose()', 'class' => 'primary'));
         } else {
             $this->addButton('save_and_continue', array('label' => $this->__('Save And Continue Edit'), 'onclick' => 'EbayAccountObj.saveAndEditClick(\'\',\'ebayAccountEditTabs\')', 'class' => 'primary'));
         }
         return;
     }
     $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'EbayAccountObj.backClick(\'' . $this->getHelper('Data')->getBackUrl('list') . '\')', 'class' => 'back'));
     $saveButtonsProps = [];
     if ($this->getHelper('Data\\GlobalData')->getValue('temp_data') && $this->getHelper('Data\\GlobalData')->getValue('temp_data')->getId()) {
         $this->addButton('delete', array('label' => $this->__('Delete'), 'onclick' => 'EbayAccountObj.deleteClick()', 'class' => 'delete M2ePro_delete_button primary'));
         $saveButtonsProps['save'] = ['label' => $this->__('Save And Back'), 'onclick' => 'EbayAccountObj.saveClick()', 'class' => 'save primary'];
     }
     // ---------------------------------------
     if (!empty($saveButtonsProps)) {
         $saveButtons = ['id' => 'save_and_continue', 'label' => $this->__('Save And Continue Edit'), 'class' => 'add', 'button_class' => '', 'onclick' => 'EbayAccountObj.saveAndEditClick(\'\')', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\SplitButton', 'options' => $saveButtonsProps];
         $this->addButton('save_buttons', $saveButtons);
     } else {
         $this->addButton('save_and_continue', ['label' => $this->__('Save And Continue Edit'), 'class' => 'add primary', 'onclick' => 'EbayAccountObj.saveAndEditClick(\'\')']);
     }
     // ---------------------------------------
 }
Esempio n. 2
0
    protected function _toHtml()
    {
        $breadcrumb = $this->createBlock('Amazon\\Listing\\Create\\Breadcrumb')->setSelectedStep((int) $this->getRequest()->getParam('step', 1));
        $helpBlock = $this->createBlock('HelpBlock')->setData(['content' => $this->__('In this Section you can specify the sources from which the values for ASIN/ISBN and
                UPC/EAN will be taken in case you have those for your Items. <br/><br/>
                These Settings will be used in two cases:

                <ul class="list">
                    <li>at the time of using Automatic ASIN/ISBN Search;</li>
                    <li>at the time of using “List” Action.</li>
                </ul>

                Using these Settings means the Search of existing Amazon Products and the process of
                linking Magento Product with found Amazon Product. <br/><br/>

                During the process of Search, Settings values are used according to the following logic:

                <ul class="list">
                    <li>the Product is searched by ASIN/ISBN parameter. (if specified);</li>
                    <li>if no result by ASIN/ISBN parameter, then UPC/EAN search is performed. (if specified);</li>
                    <li>if no result by UPC/EAN parameter, then additional search by Magento Product Name is performed.
                    (if enabled).</li>
                </ul>
                <br/>
                More detailed information you can find 
                <a href="%url%" target="_blank">here</a>.', $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/YQItAQ'))]);
        return $breadcrumb->toHtml() . $helpBlock->toHtml() . parent::_toHtml();
    }
Esempio n. 3
0
 protected function _toHtml()
 {
     $breadcrumb = $this->createBlock('Amazon\\Listing\\Create\\Breadcrumb')->setSelectedStep((int) $this->getRequest()->getParam('step', 1));
     $helpBlock = $this->createBlock('HelpBlock')->setData(['content' => $this->__('<p>It is necessary to select an Amazon Account (existing or create a new one) as well as choose
             a Marketplace that you are going to sell Magento Products on.</p>
             <p>It is also important to specify a Store View in accordance with which Magento Attribute
             values will be used in the Listing settings.</p><br>
             <p>More detailed information you can find <a href="%url%" target="_blank">here</a>.</p>', $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/XQItAQ'))]);
     return $breadcrumb->toHtml() . '<div id="progress_bar"></div>' . $helpBlock->toHtml() . '<div id="content_container">' . parent::_toHtml() . '</div>';
 }
Esempio n. 4
0
 public function _construct()
 {
     parent::_construct();
     // Initialization block
     // ---------------------------------------
     $this->setId('amazonAccountEdit');
     $this->_controller = 'adminhtml_amazon_account';
     // ---------------------------------------
     // Set buttons actions
     // ---------------------------------------
     $this->removeButton('back');
     $this->removeButton('reset');
     $this->removeButton('delete');
     $this->removeButton('add');
     $this->removeButton('save');
     $this->removeButton('edit');
     // ---------------------------------------
     /* @var $wizardHelper \Ess\M2ePro\Helper\Module\Wizard */
     $wizardHelper = $this->getHelper('Module\\Wizard');
     if ($wizardHelper->isActive(\Ess\M2ePro\Helper\View\Amazon::WIZARD_INSTALLATION_NICK)) {
         // ---------------------------------------
         $this->addButton('save_and_continue', array('label' => $this->__('Save And Continue Edit'), 'onclick' => 'AmazonAccountObj.saveAndEditClick(\'\',\'amazonAccountEditTabs\')', 'class' => 'action-primary'));
         // ---------------------------------------
         if ($this->getRequest()->getParam('id')) {
             // ---------------------------------------
             $url = $this->getUrl('*/amazon_account/new', array('wizard' => true));
             $this->addButton('add_new_account', array('label' => $this->__('Add New Account'), 'onclick' => 'setLocation(\'' . $url . '\')', 'class' => 'action-primary'));
             // ---------------------------------------
         }
     } else {
         if ((bool) $this->getRequest()->getParam('close_on_save', false)) {
             if ($this->getRequest()->getParam('id')) {
                 $this->addButton('save', array('label' => $this->__('Save And Close'), 'onclick' => 'AmazonAccountObj.saveAndClose()', 'class' => 'action-primary'));
             } else {
                 $this->addButton('save_and_continue', array('label' => $this->__('Save And Continue Edit'), 'onclick' => 'AmazonAccountObj.saveAndEditClick(\'\',\'amazonAccountEditTabs\')', 'class' => 'action-primary'));
             }
             return;
         }
         // ---------------------------------------
         $url = $this->getHelper('Data')->getBackUrl('list');
         $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'AmazonAccountObj.backClick(\'' . $url . '\')', 'class' => 'back'));
         // ---------------------------------------
         // ---------------------------------------
         if ($this->getHelper('Data\\GlobalData')->getValue('temp_data') && $this->getHelper('Data\\GlobalData')->getValue('temp_data')->getId()) {
             // ---------------------------------------
             $this->addButton('delete', array('label' => $this->__('Delete'), 'onclick' => 'AmazonAccountObj.deleteClick()', 'class' => 'delete M2ePro_delete_button primary'));
             // ---------------------------------------
         }
         // ---------------------------------------
         $saveButtons = ['id' => 'save_and_continue', 'label' => $this->__('Save And Continue Edit'), 'class' => 'add', 'button_class' => '', 'onclick' => 'AmazonAccountObj.saveAndEditClick(\'\',\'amazonAccountEditTabs\')', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\SplitButton', 'options' => ['save' => ['label' => $this->__('Save And Back'), 'onclick' => 'AmazonAccountObj.saveClick()', 'class' => 'action-primary']]];
         $this->addButton('save_buttons', $saveButtons);
         // ---------------------------------------
     }
 }
Esempio n. 5
0
 public function _construct()
 {
     parent::_construct();
     // Initialization block
     // ---------------------------------------
     $this->setId('amazonOrderView');
     $this->_controller = 'adminhtml_amazon_order';
     $this->_mode = 'view';
     // ---------------------------------------
     $this->order = $this->getHelper('Data\\GlobalData')->getValue('order');
     // Set buttons actions
     // ---------------------------------------
     $this->removeButton('back');
     $this->removeButton('reset');
     $this->removeButton('delete');
     $this->removeButton('add');
     $this->removeButton('save');
     $this->removeButton('edit');
     // ---------------------------------------
     // ---------------------------------------
     $url = $this->getHelper('Data')->getBackUrl('*/*/index');
     $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'CommonObj.backClick(\'' . $url . '\')', 'class' => 'back'));
     // ---------------------------------------
     if ($this->order->getChildObject()->canUpdateShippingStatus() && !$this->order->getChildObject()->isPrime()) {
         // ---------------------------------------
         $url = $this->getUrl('*/*/updateShippingStatus', array('id' => $this->order->getId()));
         $this->addButton('update_shipping_status', array('label' => $this->__('Mark as Shipped'), 'onclick' => "setLocation('" . $url . "');", 'class' => 'primary'));
         // ---------------------------------------
     }
     if ($this->order->getReserve()->isPlaced()) {
         // ---------------------------------------
         $url = $this->getUrl('*/order/reservationCancel', array('ids' => $this->order->getId()));
         $this->addButton('reservation_cancel', array('label' => $this->__('Cancel QTY Reserve'), 'onclick' => "confirmSetLocation(M2ePro.translator.translate('Are you sure?'), '" . $url . "');", 'class' => 'primary'));
         // ---------------------------------------
     } elseif ($this->order->isReservable()) {
         // ---------------------------------------
         $url = $this->getUrl('*/order/reservationPlace', array('ids' => $this->order->getId()));
         $this->addButton('reservation_place', array('label' => $this->__('Reserve QTY'), 'onclick' => "confirmSetLocation(M2ePro.translator.translate('Are you sure?'), '" . $url . "');", 'class' => 'primary'));
         // ---------------------------------------
     }
     if (is_null($this->order->getMagentoOrderId())) {
         // ---------------------------------------
         $url = $this->getUrl('*/*/createMagentoOrder', array('id' => $this->order->getId()));
         $this->addButton('order', array('label' => $this->__('Create Magento Order'), 'onclick' => "setLocation('" . $url . "');", 'class' => 'primary'));
         // ---------------------------------------
     } elseif (is_null($this->order->getMagentoOrder()) || $this->order->getMagentoOrder()->isCanceled()) {
         // ---------------------------------------
         $url = $this->getUrl('*/*/createMagentoOrder', array('id' => $this->order->getId(), 'force' => 'yes'));
         $confirm = $this->getHelper('Data')->escapeJs($this->__('Are you sure that you want to create new Magento Order?'));
         $this->addButton('order', array('label' => $this->__('Create Magento Order'), 'onclick' => "confirmSetLocation('" . $confirm . "','" . $url . "');", 'class' => 'primary'));
         // ---------------------------------------
     }
 }
Esempio n. 6
0
 public function _construct()
 {
     parent::_construct();
     $this->_controller = 'adminhtml_ebay_template';
     $this->_mode = 'edit';
     // ---------------------------------------
     $nick = $this->getTemplateNick();
     $template = $this->getHelper('Data\\GlobalData')->getValue("ebay_template_{$nick}");
     // ---------------------------------------
     // Set buttons actions
     // ---------------------------------------
     $this->buttonList->remove('reset');
     $this->buttonList->remove('delete');
     $this->buttonList->remove('save');
     // ---------------------------------------
     // ---------------------------------------
     $isSaveAndClose = (bool) $this->getRequest()->getParam('close_on_save', false);
     // ---------------------------------------
     if ($template->getId() && !$isSaveAndClose) {
         $duplicateHeaderText = $this->getHelper('Data')->escapeJs($this->__('Add %template_name% Policy', $this->getTemplateName()));
         $onclickHandler = $nick == \Ess\M2ePro\Model\Ebay\Template\Manager::TEMPLATE_DESCRIPTION ? 'EbayTemplateDescriptionObj' : 'EbayTemplateEditObj';
         $this->buttonList->add('duplicate', array('label' => $this->__('Duplicate'), 'onclick' => $onclickHandler . '.duplicateClick(
                 \'ebay-template\', \'' . $duplicateHeaderText . '\', \'' . $nick . '\'
             )', 'class' => 'add M2ePro_duplicate_button primary'));
         $url = $this->getUrl('*/ebay_template/delete');
         $this->buttonList->add('delete', ['label' => $this->__('Delete'), 'onclick' => 'EbayTemplateEditObj.deleteClick(\'' . $url . '\')', 'class' => 'delete M2ePro_delete_button primary']);
     }
     // ---------------------------------------
     $saveConfirmation = '';
     if ($template->getId()) {
         $saveConfirmation = $this->getHelper('Data')->escapeJs($this->__('<br/><b>Note:</b> All changes you have made will be automatically
                 applied to all M2E Pro Listings where this Policy is used.'));
     }
     // ---------------------------------------
     $saveButtonsProps = [];
     $url = $this->getUrl('*/ebay_template/save');
     if (!$isSaveAndClose) {
         $saveButtonsProps['save'] = ['label' => $this->__('Save And Back'), 'onclick' => 'EbayTemplateEditObj.saveClick(' . '\'' . $url . '\',' . '\'' . $saveConfirmation . '\',' . '\'' . $nick . '\'' . ')'];
     }
     if ($isSaveAndClose) {
         $saveButtonsProps['save'] = ['label' => $this->__('Save And Close'), 'onclick' => "EbayTemplateEditObj.saveAndCloseClick('{$url}')"];
         $this->removeButton('back');
     }
     $backUrl = $this->getHelper('Data')->makeBackUrlParam('edit', []);
     $url = $this->getUrl('*/ebay_template/save', ['back' => $backUrl]);
     $saveButtons = ['id' => 'save_and_continue', 'label' => $this->__('Save And Continue Edit'), 'class' => 'add', 'button_class' => '', 'onclick' => 'EbayTemplateEditObj.saveAndEditClick(' . '\'' . $url . '\',' . '\'\',' . '\'' . $saveConfirmation . '\',' . '\'' . $nick . '\'' . ')', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\SplitButton', 'options' => $saveButtonsProps];
     $this->addButton('save_buttons', $saveButtons);
 }
Esempio n. 7
0
    protected function _toHtml()
    {
        $breadcrumb = $this->createBlock('Amazon\\Listing\\Create\\Breadcrumb')->setSelectedStep((int) $this->getRequest()->getParam('step', 1));
        $helpBlock = $this->createBlock('HelpBlock')->setData(['content' => $this->__('On this Page you can specify main <strong>Selling Settings</strong> for Amazon Items you are going
                to sell using this M2E Pro Listing.<br/><br/>

                You can provide a settings for SKU formating, appropriate Condition,
                Condition Note, Gift Wrap, Gift Message and also specify
                Additional Settings - Handling Time and Restock Date.<br/><br/>

                In addition to, in this Section you can select Selling Format Policy that contains
                Settings connected with forming
                of Price, Quantity etc. and Synchronization Policy that describes Rules of
                Automatic Synchronization of Magento Product and Amazon Item.<br/><br/>
                More detailed information you can find
                <a href="%url%" target="_blank">here</a>.', $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/XwItAQ'))]);
        return $breadcrumb->toHtml() . $helpBlock->toHtml() . parent::_toHtml();
    }
Esempio n. 8
0
    protected function _toHtml()
    {
        $this->jsTranslator->addTranslations(['Apply Settings' => $this->__('Apply Settings')]);
        $listing = $this->getHelper('Data\\GlobalData')->getValue('listing_for_products_category_settings');
        $this->js->addOnReadyJs(<<<JS
require([
    'M2ePro/Ebay/Listing/Product/Category/Settings/Mode'
], function(){

    window.EbayListingProductCategorySettingsModeObj = new EbayListingProductCategorySettingsMode(
        '{$this->getData('mode')}'
    );

});
JS
);
        $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $listing]]);
        return $viewHeaderBlock->toHtml() . parent::_toHtml() . <<<HTML
<div id="mode_same_remember_pop_up_content" style="display: none">
        {$this->__('If you continue the Settings you will choose next will be applied to the current M2E Pro Listing
            and automatically assigned to all Products added later.<br/><br/>')}
</div>
HTML;
    }
Esempio n. 9
0
 protected function _toHtml()
 {
     return '<div id="marketplaces_progress_bar"></div>' . '<div id="marketplaces_content_container">' . parent::_toHtml() . '</div>';
 }
Esempio n. 10
0
    public function getFormHtml()
    {
        $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $this->listing]]);
        $tabs = $this->getChildBlock('tabs');
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\AutoAction', ['id' => $this->getRequest()->getParam('id')]));
        $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.')]);
        $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Model\\Listing'));
        $this->js->addOnReadyJs(<<<JS
    require([
        'M2ePro/Amazon/Listing/AutoAction'
    ], function(){
    
        window.ListingAutoActionObj = new AmazonListingAutoAction();

    });
JS
);
        return $viewHeaderBlock->toHtml() . $tabs->toHtml() . parent::getFormHtml();
    }
Esempio n. 11
0
 protected function _toHtml()
 {
     $listing = $this->getHelper('Data\\GlobalData')->getValue('listing_for_products_add');
     $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $listing]]);
     return $viewHeaderBlock->toHtml() . parent::_toHtml();
 }
Esempio n. 12
0
 protected function _beforeToHtml()
 {
     $this->jsTranslator->addTranslations(['Do not show any more' => $this->__('Do not show this message anymore'), 'Save Policy' => $this->__('Save Policy')]);
     return parent::_beforeToHtml();
 }
Esempio n. 13
0
 protected function _construct()
 {
     $this->_controller = 'adminhtml_listing';
     parent::_construct();
 }
Esempio n. 14
0
    public function getFormHtml()
    {
        $html = '';
        $tabs = $this->getChildBlock('tabs');
        // ---------------------------------------
        $html .= $this->createBlock('Ebay\\Listing\\Template\\Switcher\\Initialization')->toHtml();
        // ---------------------------------------
        //        // ---------------------------------------
        //        $data = array(
        //            'display_tab_buttons' => false
        //        );
        //        $block = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_floatingToolbarFixer');
        //        $block->addData($data);
        //        $html .= $block->toHtml();
        //        // ---------------------------------------
        // ---------------------------------------
        $listing = $this->getHelper('Data\\GlobalData')->getValue('ebay_listing');
        $headerHtml = '';
        if ($listing) {
            $headerBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $listing]]);
            $headerBlock->setListingViewMode(true);
            $headerHtml = $headerBlock->toHtml();
        }
        // ---------------------------------------
        // hide tabs selector if only one tab is allowed for displaying
        // ---------------------------------------
        if (count($this->getAllowedTabs()) == 1) {
            $this->js->add(<<<JS
    require([], function(){
        \$('{$tabs->getId()}').hide();
    });        
JS
);
        }
        // ---------------------------------------
        return $html . $headerHtml . $tabs->toHtml() . parent::getFormHtml();
    }
Esempio n. 15
0
 protected function _toHtml()
 {
     $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $this->listing]]);
     return $viewHeaderBlock->toHtml() . parent::_toHtml();
 }