Example #1
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'action' => $this->getUrl('*/*/save'), 'method' => 'post', 'enctype' => 'multipart/form-data']]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #2
0
 protected function _prepareForm()
 {
     $defaultStoreId = $this->getHelper('Magento\\Store')->getDefaultStoreId();
     // ---------------------------------------
     $userId = $this->authSession->getUser()->getId();
     $userInfo = $this->user->load($userId)->getData();
     $tempPath = defined('Mage_Shipping_Model_Config::XML_PATH_ORIGIN_CITY') ? \Magento\Shipping\Model\Config::XML_PATH_ORIGIN_CITY : 'shipping/origin/city';
     $userInfo['city'] = $this->_storeManager->getStore($defaultStoreId)->getConfig($tempPath);
     $tempPath = defined('Mage_Shipping_Model_Config::XML_PATH_ORIGIN_POSTCODE') ? \Magento\Shipping\Model\Config::XML_PATH_ORIGIN_POSTCODE : 'shipping/origin/postcode';
     $userInfo['postal_code'] = $this->_storeManager->getStore($defaultStoreId)->getConfig($tempPath);
     $userInfo['country'] = $this->_storeManager->getStore($defaultStoreId)->getConfig('general/country/default');
     // ---------------------------------------
     $licenseFormData = $userInfo;
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'method' => 'post', 'action' => $this->getUrl('*/*/save')]]);
     $fieldSet = $form->addFieldset('create_new_license', ['legend' => '', 'collapsable' => false]);
     $fieldSet->addField('create_new_license_email', 'text', ['name' => 'email', 'label' => $this->__('Email'), 'title' => $this->__('Email'), 'value' => isset($licenseFormData['email']) ? $licenseFormData['email'] : '', 'required' => true]);
     $fieldSet->addField('create_new_license_firstname', 'text', ['name' => 'firstname', 'label' => $this->__('First Name'), 'title' => $this->__('First Name'), 'value' => isset($licenseFormData['firstname']) ? $licenseFormData['firstname'] : '', 'required' => true]);
     $fieldSet->addField('create_new_license_lastname', 'text', ['name' => 'lastname', 'label' => $this->__('Last Name'), 'title' => $this->__('Last Name'), 'value' => isset($licenseFormData['lastname']) ? $licenseFormData['lastname'] : '', 'required' => true]);
     $fieldSet->addField('create_new_license_country', self::SELECT, ['name' => 'country', 'label' => $this->__('Country'), 'title' => $this->__('Country'), 'values' => $this->country->toOptionArray(), 'value' => isset($licenseFormData['country']) ? $licenseFormData['country'] : '', 'required' => true]);
     $fieldSet->addField('create_new_license_city', 'text', ['name' => 'city', 'label' => $this->__('City'), 'title' => $this->__('City'), 'value' => isset($licenseFormData['city']) ? $licenseFormData['city'] : '', 'required' => true]);
     $fieldSet->addField('create_new_license_postal_code', 'text', ['name' => 'postal_code', 'label' => $this->__('Postal Code'), 'title' => $this->__('Postal Code'), 'value' => isset($licenseFormData['postal_code']) ? $licenseFormData['postal_code'] : '', 'required' => true]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #3
0
 protected function _prepareForm()
 {
     $template = $this->getHelper('Data\\GlobalData')->getValue('tmp_template');
     $formData = !is_null($template) ? array_merge($template->getData(), $template->getChildObject()->getData()) : [];
     $defaults = array('stop_status_disabled' => Synchronization::STOP_STATUS_DISABLED_YES, 'stop_out_off_stock' => Synchronization::STOP_OUT_OFF_STOCK_YES, 'stop_qty_magento' => Synchronization::STOP_QTY_NONE, 'stop_qty_magento_value' => '0', 'stop_qty_magento_value_max' => '10', 'stop_qty_calculated' => Synchronization::STOP_QTY_NONE, 'stop_qty_calculated_value' => '0', 'stop_qty_calculated_value_max' => '10');
     $formData = array_merge($defaults, $formData);
     $isEdit = !!$this->getRequest()->getParam('id');
     $form = $this->_formFactory->create();
     $form->addField('amazon_template_synchronization_stop', self::HELP_BLOCK, ['content' => $this->__('Stop Rules define the Conditions when Amazon Items Listing must be
 inactivated, depending on Magento Product state.<br/><br/>
 <b>Note:</b> If all Stop Conditions are set to <i>No</i> or <i>No Action</i>,
 then the Stop Option for Amazon Items is disabled.<br/>
 If all Stop Conditions are enabled, then an Item will be inactivated if at least one of the
 Stop Conditions is met.<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/HIMVAQ'))]);
     $fieldset = $form->addFieldset('magento_block_ebay_template_synchronization_form_data_stop_rules', ['legend' => $this->__('Stop Conditions'), 'collapsable' => false]);
     $fieldset->addField('stop_status_disabled', 'select', ['name' => 'stop_status_disabled', 'label' => $this->__('Stop When Status Disabled'), 'value' => $formData['stop_status_disabled'], 'values' => [Synchronization::STOP_STATUS_DISABLED_NONE => $this->__('No'), Synchronization::STOP_STATUS_DISABLED_YES => $this->__('Yes')], 'tooltip' => $this->__('Automatically stops Item(s) if its status has been changed to \'Disabled\' in Magento.')]);
     $fieldset->addField('stop_out_off_stock', 'select', ['name' => 'stop_out_off_stock', 'label' => $this->__('Stop When Out Of Stock'), 'value' => $formData['stop_out_off_stock'], 'values' => [Synchronization::STOP_OUT_OFF_STOCK_NONE => $this->__('No'), Synchronization::STOP_OUT_OFF_STOCK_YES => $this->__('Yes')], 'tooltip' => $this->__('Automatically stops Item(s) if its Stock availability has been changed to \'Out of Stock\'
                 in Magento.')]);
     $fieldset->addField('stop_qty_magento', 'select', ['name' => 'stop_qty_magento', 'label' => $this->__('Stop When Magento Quantity Is'), 'value' => $formData['stop_qty_magento'], 'values' => [Synchronization::STOP_QTY_NONE => $this->__('No Action'), Synchronization::STOP_QTY_LESS => $this->__('Less or Equal'), Synchronization::STOP_QTY_BETWEEN => $this->__('Between')], 'tooltip' => $this->__('Automatically stops Item(s) if Magento Quantity has been changed and meets the Conditions.')])->addCustomAttribute('qty_type', 'magento');
     $fieldset->addField('stop_qty_magento_value', 'text', ['container_id' => 'stop_qty_magento_value_container', 'name' => 'stop_qty_magento_value', 'label' => $this->__('Quantity'), 'value' => $formData['stop_qty_magento_value'], 'class' => 'validate-digits', 'required' => true]);
     $fieldset->addField('stop_qty_magento_value_max', 'text', ['container_id' => 'stop_qty_magento_value_max_container', 'name' => 'stop_qty_magento_value_max', 'label' => $this->__('Max Quantity'), 'value' => $formData['stop_qty_magento_value_max'], 'class' => 'validate-digits M2ePro-validate-conditions-between', 'required' => true]);
     $fieldset->addField('stop_qty_calculated', 'select', ['name' => 'stop_qty_calculated', 'label' => $this->__('Stop When Calculated Quantity Is'), 'value' => $formData['stop_qty_calculated'], 'values' => [Synchronization::STOP_QTY_NONE => $this->__('No Action'), Synchronization::STOP_QTY_LESS => $this->__('Less or Equal'), Synchronization::STOP_QTY_BETWEEN => $this->__('Between')], 'tooltip' => $this->__('Automatically stops Item(s) if Calculated Quantity according to the Selling Format
                 Policy has been changed and meets the Conditions.')])->addCustomAttribute('qty_type', 'calculated');
     $fieldset->addField('stop_qty_calculated_value', 'text', ['container_id' => 'stop_qty_calculated_value_container', 'name' => 'stop_qty_calculated_value', 'label' => $this->__('Quantity'), 'value' => $formData['stop_qty_calculated_value'], 'class' => 'validate-digits', 'required' => true]);
     $fieldset->addField('stop_qty_calculated_value_max', 'text', ['container_id' => 'stop_qty_calculated_value_max_container', 'name' => 'stop_qty_calculated_value_max', 'label' => $this->__('Max Quantity'), 'value' => $formData['stop_qty_calculated_value_max'], 'class' => 'validate-digits M2ePro-validate-conditions-between', 'required' => true]);
     $jsFormData = ['stop_status_disabled', 'stop_out_off_stock', 'stop_qty_magento', 'stop_qty_magento_value', 'stop_qty_magento_value_max', 'stop_qty_calculated', 'stop_qty_calculated_value', 'stop_qty_calculated_value_max'];
     foreach ($jsFormData as $item) {
         $this->js->add("M2ePro.formData.{$item} = '{$this->getHelper('Data')->escapeJs($formData[$item])}';");
     }
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #4
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'action' => 'javascript:void(0)', 'method' => 'post']]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #5
0
 protected function _toHtml()
 {
     if ($this->getRequest()->getParam('step')) {
         $breadcrumb = $this->createBlock('Ebay\\Listing\\Create\\Breadcrumb');
         $breadcrumb->setSelectedStep((int) $this->getRequest()->getParam('step', 2));
         return $breadcrumb->_toHtml() . parent::_toHtml();
     }
     return parent::_toHtml();
 }
Example #6
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'method' => 'post', 'action' => 'javascript:void(0)']]);
     $fieldSet = $form->addFieldset('change_license', ['legend' => '', 'collapsable' => false]);
     $key = $this->getHelper('Data')->escapeHtml($this->getHelper('Module\\License')->getKey());
     $fieldSet->addField('new_license_key', 'text', ['name' => 'new_license_key', 'label' => $this->__('New License Key'), 'title' => $this->__('New License Key'), 'value' => $key, 'required' => true]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #7
0
    protected function _prepareForm()
    {
        $template = $this->getHelper('Data\\GlobalData')->getValue('tmp_template');
        $formData = !is_null($template) ? array_merge($template->getData(), $template->getChildObject()->getData()) : [];
        $defaults = array('relist_mode' => Synchronization::RELIST_MODE_YES, 'relist_filter_user_lock' => Synchronization::RELIST_FILTER_USER_LOCK_YES, 'relist_send_data' => Synchronization::RELIST_SEND_DATA_NONE, 'relist_status_enabled' => Synchronization::RELIST_STATUS_ENABLED_YES, 'relist_is_in_stock' => Synchronization::RELIST_IS_IN_STOCK_YES, 'relist_qty_magento' => Synchronization::RELIST_QTY_NONE, 'relist_qty_magento_value' => '1', 'relist_qty_magento_value_max' => '10', 'relist_qty_calculated' => Synchronization::RELIST_QTY_NONE, 'relist_qty_calculated_value' => '1', 'relist_qty_calculated_value_max' => '10');
        $formData = array_merge($defaults, $formData);
        $isEdit = !!$this->getRequest()->getParam('id');
        $form = $this->_formFactory->create();
        $form->addField('amazon_template_synchronization_general', self::HELP_BLOCK, ['content' => $this->__(<<<HTML
                    <p>If <strong>Relist Action</strong> is enabled and the specified conditions are met,
                    M2E Pro will relist Items that have been inactive on Amazon. 
                    (Relist Action will not list Items that have not been Listed yet)</p><br>
                    <p>If the Item does not get automatically Relisted (usually because of the errors returned 
                    by Amazon), M2E Pro will attempt to relist the Item again only if there is a change of 
                    Product Status, Stock Availability or Quantity in Magento.</p><br>
                    <p>More detailed information about how to work with this Page you can find 
                    <a href="%url%">here</a>.</p>
HTML
, $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/SQItAQ'))]);
        $fieldset = $form->addFieldset('magento_block_amazon_template_synchronization_relist_filters', ['legend' => $this->__('General'), 'collapsable' => false]);
        $fieldset->addField('relist_mode', 'select', ['name' => 'relist_mode', 'label' => $this->__('Relist Action'), 'value' => $formData['relist_mode'], 'values' => [Synchronization::RELIST_MODE_NONE => $this->__('Disabled'), Synchronization::RELIST_MODE_YES => $this->__('Enabled')], 'tooltip' => $this->__('Enables/Disables the Relist Action for the Listings, which use current Synchronization Policy.')]);
        $fieldset->addField('relist_filter_user_lock', 'select', ['container_id' => 'relist_filter_user_lock_tr_container', 'name' => 'relist_filter_user_lock', 'label' => $this->__('Relist When Stopped Manually'), 'value' => $formData['relist_filter_user_lock'], 'values' => [Synchronization::RELIST_FILTER_USER_LOCK_YES => $this->__('No'), Synchronization::RELIST_FILTER_USER_LOCK_NONE => $this->__('Yes')], 'tooltip' => $this->__('Automatically Relists Item(s) even it has been Stopped manually within M2E Pro.')]);
        $fieldset->addField('relist_send_data', 'select', ['container_id' => 'relist_send_data_tr_container', 'name' => 'relist_send_data', 'label' => $this->__('Synchronize Data'), 'value' => $formData['relist_send_data'], 'values' => [Synchronization::RELIST_SEND_DATA_NONE => $this->__('No'), Synchronization::RELIST_SEND_DATA_YES => $this->__('Yes')], 'tooltip' => $this->__('<p><strong>No:</strong> Items are Relisted on eBay as per previously Listed Information and 
                    Settings, ignoring any changes that have been made in Magento. (Recommended)</p>
                    <p><strong>Yes:</strong> Any changes made to Items in Magento will be Reflected on Amazon 
                    Listings after they are Relisted.</p>')]);
        $fieldset = $form->addFieldset('magento_block_amazon_template_synchronization_relist_rules', ['legend' => $this->__('Relist Conditions'), 'collapsable' => false]);
        $fieldset->addField('relist_status_enabled', 'select', ['name' => 'relist_status_enabled', 'label' => $this->__('Product Status'), 'value' => $formData['relist_status_enabled'], 'values' => [Synchronization::RELIST_STATUS_ENABLED_NONE => $this->__('Any'), Synchronization::RELIST_STATUS_ENABLED_YES => $this->__('Enabled')], 'class' => 'M2ePro-validate-stop-relist-conditions-product-status', 'tooltip' => $this->__('<p><strong>Enabled:</strong> List Items on Amazon automatically if they have status Enabled 
                    in Magento Product. (Recommended)</p> 
                    <p><strong>Any:</strong> List Items with any Magento Product status on Amazon automatically.</p>')]);
        $fieldset->addField('relist_is_in_stock', 'select', ['name' => 'relist_is_in_stock', 'label' => $this->__('Stock Availability'), 'value' => $formData['relist_is_in_stock'], 'values' => [Synchronization::RELIST_IS_IN_STOCK_NONE => $this->__('Any'), Synchronization::RELIST_IS_IN_STOCK_YES => $this->__('In Stock')], 'class' => 'M2ePro-validate-stop-relist-conditions-stock-availability', 'tooltip' => $this->__('<p><strong>In Stock:</strong> List Items automatically if Products are in Stock. 
                    (Recommended.)</p>
                    <p><strong>Any:</strong> List Items automatically, regardless of Stock availability.</p>')]);
        $fieldset->addField('relist_qty_magento', 'select', ['name' => 'relist_qty_magento', 'label' => $this->__('Magento Quantity'), 'value' => $formData['relist_qty_magento'], 'values' => [Synchronization::RELIST_QTY_NONE => $this->__('Any'), Synchronization::RELIST_QTY_MORE => $this->__('More or Equal'), Synchronization::RELIST_QTY_BETWEEN => $this->__('Between')], 'class' => 'M2ePro-validate-stop-relist-conditions-item-qty', 'tooltip' => $this->__('<p><strong>Any:</strong> List Items automatically with any Quantity available.</p>
                    <p><strong>More or Equal:</strong> List Items automatically if the Quantity available in 
                    Magento is at least equal to the number you set. (Recommended)</p>
                    <p><strong>Between:</strong> List Items automatically if the Quantity available in Magento is
                    between the minimum and maximum numbers you set.</p>')])->addCustomAttribute('qty_type', 'magento');
        $fieldset->addField('relist_qty_magento_value', 'text', ['container_id' => 'relist_qty_magento_value_container', 'name' => 'relist_qty_magento_value', 'label' => $this->__('Quantity'), 'value' => $formData['relist_qty_magento_value'], 'class' => 'validate-digits', 'required' => true]);
        $fieldset->addField('relist_qty_magento_value_max', 'text', ['container_id' => 'relist_qty_magento_value_max_container', 'name' => 'relist_qty_magento_value_max', 'label' => $this->__('Max Quantity'), 'value' => $formData['relist_qty_magento_value_max'], 'class' => 'validate-digits M2ePro-validate-conditions-between', 'required' => true]);
        $fieldset->addField('relist_qty_calculated', 'select', ['name' => 'relist_qty_calculated', 'label' => $this->__('Calculated Quantity'), 'value' => $formData['relist_qty_calculated'], 'values' => [Synchronization::RELIST_QTY_NONE => $this->__('Any'), Synchronization::RELIST_QTY_MORE => $this->__('More or Equal'), Synchronization::RELIST_QTY_BETWEEN => $this->__('Between')], 'class' => 'M2ePro-validate-stop-relist-conditions-item-qty', 'tooltip' => $this->__('<p><strong>Any:</strong> List Items automatically with any Quantity available.</p>
                    <p><strong>More or Equal:</strong> List Items automatically if the calculated Quantity is at
                    least equal to the number you set, according to the Price, Quantity and Format Policy. 
                    (Recommended)</p>
                    <p><strong>Between:</strong> List Items automatically if the Quantity is between the minimum 
                    and maximum numbers you set, according to the Price, Quantity and Format Policy.</p>')])->addCustomAttribute('qty_type', 'calculated');
        $fieldset->addField('relist_qty_calculated_value', 'text', ['container_id' => 'relist_qty_calculated_value_container', 'name' => 'relist_qty_calculated_value', 'label' => $this->__('Quantity'), 'value' => $formData['relist_qty_calculated_value'], 'class' => 'validate-digits', 'required' => true]);
        $fieldset->addField('relist_qty_calculated_value_max', 'text', ['container_id' => 'relist_qty_calculated_value_max_container', 'name' => 'relist_qty_calculated_value_max', 'label' => $this->__('Max Quantity'), 'value' => $formData['relist_qty_calculated_value_max'], 'class' => 'validate-digits M2ePro-validate-conditions-between', 'required' => true]);
        $jsFormData = ['relist_mode', 'relist_status_enabled', 'relist_is_in_stock', 'relist_qty_magento', 'relist_qty_magento_value', 'relist_qty_magento_value_max', 'relist_qty_calculated', 'relist_qty_calculated_value', 'relist_qty_calculated_value_max'];
        foreach ($jsFormData as $item) {
            $this->js->add("M2ePro.formData.{$item} = '{$this->getHelper('Data')->escapeJs($formData[$item])}';");
        }
        $this->setForm($form);
        return parent::_prepareForm();
    }
    protected function _beforeToHtml()
    {
        $this->jsUrl->add($this->getUrl('*/developers/save'), 'developers/save');
        $this->jsTranslator->add('Settings successfully saved', $this->__('Settings successfully saved'));
        $this->js->addRequireJs(['d' => 'M2ePro/Developers'], <<<JS

        window.DevelopersObj = new Developers();
JS
);
        return parent::_beforeToHtml();
    }
Example #9
0
 protected function _toHtml()
 {
     $helpBlock = $this->createBlock('HelpBlock')->setData(['content' => $this->__('
         In order to prove that this is your Product, you need to provide SKU of the respective Product
         in your Amazon Inventory. Please follow the Rules below to avoid issues:
         <ul class="list">
             <li>The SKU has to be related to Parent Product in your Amazon Inventory;</li>
             <li>ASIN(s)/ISBN(s) in M2E Pro and in Amazon Inventory have to be the same;</li>
             <li>The Product in the Amazon Inventory has to be visible via Amazon API.</li>
         </ul>')]);
     return '<div id="manage_variation_sku_popup">' . $helpBlock->toHtml() . parent::_toHtml() . '</div>';
 }
Example #10
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create();
     $fieldSet = $form->addFieldset('field_module', ['legend' => $this->__('Module'), 'collapsable' => false]);
     $fieldSet->addField('m2e_version', 'note', ['label' => $this->__('Version'), 'text' => $this->getHelper('Module')->getVersion()]);
     $fieldSet->addField('m2e_revision', 'note', ['label' => $this->__('Revision'), 'text' => $this->getHelper('Module')->getRevision()]);
     $fieldSet = $form->addFieldset('field_magento', ['legend' => $this->__('Magento'), 'collapsable' => false]);
     $fieldSet->addField('magento_edition', 'note', ['label' => $this->__('Edition'), 'text' => ucfirst($this->getHelper('Magento')->getEditionName())]);
     $fieldSet->addField('magento_version', 'note', ['label' => $this->__('Version'), 'text' => $this->getHelper('Magento')->getVersion()]);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #11
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form']]);
     $fieldset = $form->addFieldset('accounts', []);
     $url = 'https://scgi.ebay.com/ws/eBayISAPI.dll?RegisterEnterInfo&bizflow=2';
     $fieldset->addField('message', self::MESSAGES, ['messages' => [['type' => \Magento\Framework\Message\MessageInterface::TYPE_NOTICE, 'content' => $this->__('If you do not have an existing account, you can click
                         <a href="%url%" target="_blank">here</a> to register one.', $url)]]]);
     $fieldset->addField('mode', 'radios', ['label' => $this->__('What the Type of Account do You Want to Onboard?'), 'css_class' => 'account-mode-choose', 'name' => 'mode', 'values' => [['value' => 'production', 'label' => $this->__('Live Account')], ['value' => 'sandbox', 'label' => $this->__('Sandbox Account')], ['value' => '', 'label' => '']], 'value' => 'production']);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #12
0
 protected function _prepareForm()
 {
     $template = $this->getHelper('Data\\GlobalData')->getValue('tmp_template');
     $formData = !is_null($template) ? array_merge($template->getData(), $template->getChildObject()->getData()) : ['title' => ''];
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'method' => 'post', 'action' => $this->getUrl('*/*/save'), 'enctype' => 'multipart/form-data']]);
     $fieldset = $form->addFieldset('magento_block_amazon_template_synchronization_general_general', ['legend' => $this->__('General'), 'collapsable' => false]);
     $fieldset->addField('title', 'text', ['name' => 'title', 'label' => $this->__('Title'), 'value' => $formData['title'], 'class' => 'M2ePro-synchronization-tpl-title', 'tooltip' => $this->__('Short meaningful Policy Title for your internal use.'), 'required' => true]);
     $dataBlock = $this->createBlock('Amazon\\Template\\Synchronization\\Edit\\Data');
     $form->addField('container_html', self::CUSTOM_CONTAINER, ['text' => $dataBlock->toHtml()]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #13
0
 protected function _prepareForm()
 {
     $templateModel = $this->getHelper('Data\\GlobalData')->getValue('tmp_template')->getData();
     $formData = !empty($templateModel) ? $templateModel : ['title' => ''];
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'method' => 'post', 'action' => $this->getUrl('*/*/save'), 'enctype' => 'multipart/form-data']]);
     $fieldSet = $form->addFieldset('magento_block_template_description_edit_main_general', ['legend' => $this->__('General'), 'collapsable' => false]);
     $fieldSet->addField('title', 'text', ['name' => 'general[title]', 'label' => $this->__('Title'), 'title' => $this->__('Title'), 'value' => $formData['title'], 'class' => 'input-text M2ePro-description-template-title', 'required' => true, 'tooltip' => $this->__('Short meaningful Policy Title for your internal use.')]);
     $dataBlock = $this->createBlock('Amazon\\Template\\Description\\Edit\\Data');
     $form->addField('content_html', self::CUSTOM_CONTAINER, ['text' => $dataBlock->toHtml()]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #14
0
    protected function _beforeToHtml()
    {
        $helpBlock = $this->createBlock('HelpBlock')->setData(['content' => $this->__('On this Tab you can specify Product Specifics for more detailed Description of its properties.
                List of available Specifics determines for the Category that you have chosen on General Tab. <br/><br/>
                To add new Specifics you can use “Add Specifics” Button at the top of a Tab or click “Plus”
                icon at the top right corner of a group to add Specifics to one particular group. Use search
                and filters to find Specifics you need. Specifics have nested structure so the same
                Specific can be used in different groups. <br/><br/>

                There is a list of required Specifics that should be specified. Recommended Specifics
                by Amazon are marked with a “Desired” label. Such Specifics are not mandatory,
                though they are recommended to be specified. <br/><br/>

                You can delete added Specifics by clicking a cross icon on the right.
                Some Specifics have a duplication Option (there is a copy icon on the right),
                i.e. you can specify several values for one Specific at the same time. <br/><br/>

                You can choose between 3 modes to specify the Specifics values:

                <ul class="list">
                    <li>Custom Value – you should set value manually;</li>
                    <li>Custom Attribute - selecting of Magento Attribute,
                    that will be a source for a Specific value;</li>
                    <li>Recommended Value (optional) - selecting of value from the list of predefined values.</li>
                </ul>
                <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/J4MVAQ'))]);
        $this->setChild('help_block', $helpBlock);
        $this->css->add(<<<CSS
        a.specific-clone-button {
            display: inline-block;
            width: 20px;
            height: 16px;
            background: no-repeat center;
            background-image: url("{$this->getViewFileUrl('Ess_M2ePro::images/duplicate.png')}");
        }

CSS
);
        $this->jsTranslator->addTranslations(['Add Specifics' => $this->__('Add Specifics'), 'Remove this specific' => $this->__('Remove this specific'), 'Total digits (not more):' => $this->__('Total digits (not more):'), 'Type: Numeric.' => $this->__('Type: Numeric.'), 'Min:' => $this->__('Min:'), 'Max:' => $this->__('Max:'), 'Can take any value.' => $this->__('Can take any value.'), 'Two uppercase letters or "unknown".' => $this->__('Two uppercase letters or "unknown".'), 'The value is incorrect.' => $this->__('The value is incorrect.'), 'Type: String.' => $this->__('Type: String.'), 'Min length:' => $this->__('Min length:'), 'Max length:' => $this->__('Max length:'), 'Type: Date time. Format: YYYY-MM-DD hh:mm:ss' => $this->__('Type: Date time. Format: YYYY-MM-DD hh:mm:ss'), 'Type: Numeric floating point.' => $this->__('Type: Numeric floating point.'), 'Decimal places (not more):' => $this->__('Decimal places (not more):'), 'Recommended Values' => $this->__('Recommended Values'), 'Allowed Values' => $this->__('Allowed Values'), 'Custom Attribute' => $this->__('Custom Attribute'), 'Custom Value' => $this->__('Custom Value'), 'None' => $this->__('None'), 'Definition:' => $this->__('Definition:'), 'Tips:' => $this->__('Tips:'), 'Examples:' => $this->__('Examples:'), 'Desired' => $this->__('Desired'), 'Duplicate specific' => $this->__('Duplicate specific'), 'Delete specific' => $this->__('Delete specific'), 'Add Specific into current container' => $this->__('Add Specific into current container'), 'Value of this Specific can be automatically overwritten by M2E Pro.' => $this->__('In case this Description Policy will be used to create New Amazon Child Products,
                value of this Specific can be automatically overwritten by M2E Pro.
                Below there is a list of Variation Themes for which the value of this
                Specific will be overwritten if you are using one of them in your Listing.'), 'Amazon Parentage Specific will be overridden notice.' => 'The Value of this Specific can be necessary due to technical reasons,
                so there is no ability to Edit the Attribute parentage and also it has no semantic load.
                In case this Description Policy uses for creation of new Amazon Parent-Child Product,
                this Value will be overwritten and the Value you selected will not be/cannot be used.']);
        $formData = json_encode($this->formData);
        $this->js->add("\r\n            wait(\r\n                function() { return typeof AmazonTemplateDescriptionCategorySpecificObj != 'undefined'; },\r\n                function() { AmazonTemplateDescriptionCategorySpecificObj.setFormDataSpecifics({$formData}); },\r\n                50\r\n            );\r\n\r\n        ");
        return parent::_beforeToHtml();
    }
Example #15
0
    protected function _prepareForm()
    {
        $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'method' => 'post', 'enctype' => 'multipart/form-data']]);
        $fieldset = $form->addFieldset('contact_us', []);
        $fieldset->addField('subject', 'text', ['name' => 'subject', 'required' => true, 'label' => $this->__('Subject')]);
        $fieldset->addField('contact_name', 'text', ['name' => 'contact_name', 'required' => true, 'label' => $this->__('Contact Name')]);
        $fieldset->addField('contact_mail', 'text', ['name' => 'contact_mail', 'required' => true, 'class' => 'M2ePro-validate-email', 'label' => $this->__('Contact Email')]);
        if ($this->getHelper('Module\\Support')->isTypePremium()) {
            $fieldset->addField('severity', 'select', ['name' => 'severity', 'label' => $this->__('Severity'), 'values' => ['minor' => $this->__('Minor'), 'important' => $this->__('Important'), 'critical' => $this->__('Critical')]]);
        }
        $values = ['none' => $this->__('General Issue')];
        if ($this->getHelper('Component\\Ebay')->isEnabled()) {
            $values[\Ess\M2ePro\Helper\Component\Ebay::NICK] = $this->getHelper('Component\\Ebay')->getChannelTitle() . ' ' . $this->__('Issue');
        }
        if ($this->getHelper('Component\\Amazon')->isEnabled()) {
            $values[\Ess\M2ePro\Helper\Component\Amazon::NICK] = $this->getHelper('Component\\Amazon')->getChannelTitle() . ' ' . $this->__('Issue');
        }
        $referrer = $this->getRequest()->getParam('referrer', false);
        if (count($values) > 1 && !$referrer) {
            $fieldset->addField('component', 'select', ['name' => 'component', 'label' => $this->__('Problem Type'), 'values' => $values, 'value' => 'none']);
        } else {
            $fieldset->addField('component', 'hidden', ['name' => 'component', 'value' => $referrer]);
        }
        $fieldset->addField('description', 'textarea', ['label' => $this->__('Description'), 'name' => 'description', 'style' => 'height: 250px', 'value' => <<<TEXT
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


Please provide any additional information below.
TEXT
]);
        $fieldset->addField('files', 'file', ['css_class' => 'no-margin-bottom', 'container_id' => 'more_button_container', 'label' => $this->__('Attachment'), 'name' => 'files[]', 'onchange' => 'SupportObj.toggleMoreButton()', 'style' => 'margin-top: 5px']);
        $fieldset->addField('more_attachments', 'button', ['container_id' => 'more_attachments_container', 'label' => '', 'value' => $this->__('Attach Another File'), 'class' => 'action-default', 'onclick' => 'SupportObj.moreAttachments()']);
        $fieldset->addField('send_button', 'button', ['label' => '', 'value' => $this->__('Submit'), 'class' => 'action-primary right', 'onclick' => 'SupportObj.saveClick()']);
        $this->jsUrl->add($this->getUrl('*/support/save'), 'formSubmit');
        $this->js->add(<<<JS
    require([
        'M2ePro/Support',
    ], function(){
        window.SupportObj = new Support();
    });
JS
);
        $form->setUseContainer(true);
        $this->setForm($form);
        return parent::_prepareForm();
    }
Example #16
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form']]);
     $fieldset = $form->addFieldset('block_notice_wizard_installation_step_license', ['legend' => '']);
     $fieldset->addField('form_email', 'text', ['name' => 'email', 'label' => $this->__('Email'), 'value' => $this->getUserInfoValue('email'), 'required' => true, 'disabled' => $this->getData('isLicenseStepFinished')]);
     $fieldset->addField('first_name', 'text', ['name' => 'firstname', 'label' => $this->__('First Name'), 'value' => $this->getUserInfoValue('firstname'), 'required' => true, 'disabled' => $this->getData('isLicenseStepFinished')]);
     $fieldset->addField('last_name', 'text', ['name' => 'lastname', 'label' => $this->__('Last Name'), 'value' => $this->getUserInfoValue('lastname'), 'required' => true, 'disabled' => $this->getData('isLicenseStepFinished')]);
     $fieldset->addField('country', 'select', ['name' => 'country', 'label' => $this->__('Country'), 'value' => $this->getUserInfoValue('country'), 'values' => $this->getData('available_countries'), 'required' => true, 'disabled' => $this->getData('isLicenseStepFinished')]);
     $fieldset->addField('city', 'text', ['name' => 'city', 'label' => $this->__('City'), 'value' => $this->getUserInfoValue('city'), 'required' => true, 'disabled' => $this->getData('isLicenseStepFinished')]);
     $fieldset->addField('postal_code', 'text', ['name' => 'postal_code', 'label' => $this->__('Postal Code'), 'value' => $this->getUserInfoValue('postal_code'), 'required' => true, 'disabled' => $this->getData('isLicenseStepFinished')]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #17
0
 protected function _prepareForm()
 {
     $global = $this->getHelper('Data\\GlobalData');
     $listing = $global->getValue('edit_listing');
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'action' => 'javascript:void(0)', 'method' => 'post']]);
     $form->addField('id', 'hidden', ['name' => 'id']);
     $fieldset = $form->addFieldset('edit_listing_fieldset', []);
     $fieldset->addField('title', 'text', ['name' => 'title', 'class' => 'validate-no-empty M2ePro-listing-title', 'label' => $this->__('Title'), 'field_extra_attributes' => 'style="margin-bottom: 0;"']);
     if ($listing) {
         $form->addValues($listing->getData());
     }
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #18
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create();
     $form->addField('show', 'hidden', ['name' => 'show', 'value' => 1]);
     $fieldset = $form->addFieldset('magento_block_ebay_template_description_form', ['legend' => $this->__('Select Product')]);
     if ($errorMessage = $this->getData('error_message')) {
         $fieldset->addField('messages', self::MESSAGES, ['messages' => [['type' => MessageInterface::TYPE_ERROR, 'content' => $errorMessage]]]);
     }
     $viewButton = $this->createBlock('Magento\\Button')->addData(['label' => $this->__('View'), 'type' => 'submit']);
     $randomButton = $this->createBlock('Magento\\Button')->addData(['label' => $this->__('View Random Product'), 'type' => 'submit', 'onclick' => '$(\'product_id\').value = \'\'; return true;']);
     $fieldset->addField('product_id', 'text', ['name' => 'id', 'value' => $this->getData('product_id'), 'label' => $this->__('Enter Product Id'), 'after_element_html' => $viewButton->toHtml() . $this->__('or') . $randomButton->toHtml()]);
     $fieldset->addField('store_id', self::STORE_SWITCHER, ['value' => $this->getData('store_id')]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #19
0
 protected function _prepareForm()
 {
     if ($this->getData('nick') == '') {
         throw new \Ess\M2ePro\Model\Exception\Logic('You should set template "nick"');
     }
     $form = $this->_formFactory->create(['data' => ['id' => 'new_template_form_' . $this->getData('nick'), 'action' => 'javascript:void(0)', 'method' => 'post']]);
     $form->addField('new_template_form_help_block', self::HELP_BLOCK, ['content' => $this->__('<p>Saving Policy under a distinctive title will let you easily and quickly search for 
                 it in case you need to use it in a different M2E Pro Listing in the future.</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/8wItAQ'))]);
     $fieldset = $form->addFieldset('new_template_fieldset', []);
     $fieldset->addField('template_title_' . $this->getData('nick'), 'text', ['name' => $this->getData('nick') . '[template_title]', 'class' => 'M2ePro-validate-ebay-template-title', 'label' => $this->__('Title'), 'placeholder' => $this->__('Please specify Policy Title'), 'required' => true]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #20
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'method' => 'post']]);
     $form->addField('source_help_block', self::HELP_BLOCK, ['content' => $this->__('<p>After an M2E Pro listing is successfully configured and created, Magento Products should
                 be added into it. <br> The Products you add to the Listing will further be Listed on eBay.</p><br>
                 <p>There are several different options of how Magento products can be found/selected 
                 and added to the Listing.</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/dwItAQ'))]);
     $fieldset = $form->addFieldset('source_mode', []);
     $defaultSource = $this->getRequest()->getParam('source', \Ess\M2ePro\Block\Adminhtml\Ebay\Listing\Product\Add\SourceMode::MODE_PRODUCT);
     $fieldset->addField('block-title', 'label', ['value' => $this->__('Choose how you want to display Products for selection'), 'field_extra_attributes' => 'style="font-weight: bold;font-size:18px;margin-bottom:0px"']);
     $fieldset->addField('source1', 'radios', ['name' => 'source', 'field_extra_attributes' => 'style="margin: 4px 0 0 0; font-weight: bold"', 'values' => [['value' => \Ess\M2ePro\Block\Adminhtml\Ebay\Listing\Product\Add\SourceMode::MODE_PRODUCT, 'label' => 'Products List']], 'value' => $defaultSource, 'note' => '<div style="padding-top: 3px; padding-left: 26px; font-weight: normal">' . $this->__('Products displayed as a list without any grouping.') . '</div>']);
     $fieldset->addField('source2', 'radios', ['name' => 'source', 'field_extra_attributes' => 'style="margin: 4px 0 0 0; font-weight: bold"', 'values' => [['value' => \Ess\M2ePro\Block\Adminhtml\Ebay\Listing\Product\Add\SourceMode::MODE_CATEGORY, 'label' => 'Categories']], 'value' => $defaultSource, 'note' => '<div style="padding-top: 3px; padding-left: 26px; font-weight: normal">' . $this->__('Products grouped by Magento Categories.') . '</div>']);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Example #21
0
    protected function _prepareForm()
    {
        /** @var \Ess\M2ePro\Model\Ebay\Order $order */
        $order = $this->getHelper('Data\\GlobalData')->getValue('order')->getChildObject();
        $buyerEmail = $order->getData('buyer_email');
        if (stripos($buyerEmail, 'Invalid Request') !== false) {
            $buyerEmail = '';
        }
        try {
            $regionCode = $order->getShippingAddress()->getRegionCode();
        } catch (\Exception $e) {
            $regionCode = null;
        }
        $address = $order->getShippingAddress()->getData();
        $form = $this->_formFactory->create(['data' => ['id' => 'edit_form']]);
        $fieldset = $form->addFieldset('order_address_info', ['legend' => $this->__('Order Address Information')]);
        $fieldset->addField('buyer_name', 'text', ['name' => 'buyer_name', 'label' => $this->__('Buyer Name'), 'value' => $this->getHelper('Data')->escapeHtml($order->getData('buyer_name')), 'required' => true]);
        $fieldset->addField('buyer_email', 'text', ['name' => 'buyer_email', 'label' => $this->__('Buyer Email'), 'value' => $this->getHelper('Data')->escapeHtml($buyerEmail), 'required' => true]);
        $fieldset->addField('street_0', 'text', ['name' => 'street[0]', 'label' => $this->__('Street Address'), 'value' => isset($address['street'][0]) ? $this->getHelper('Data')->escapeHtml($address['street'][0]) : '', 'required' => true]);
        $fieldset->addField('street_1', 'text', ['name' => 'street[1]', 'label' => '', 'value' => isset($address['street'][1]) ? $this->getHelper('Data')->escapeHtml($address['street'][1]) : '']);
        $fieldset->addField('city', 'text', ['name' => 'city', 'label' => $this->__('City'), 'value' => $this->getHelper('Data')->escapeHtml($address['city']), 'required' => true]);
        $fieldset->addField('country_code', 'select', ['name' => 'country_code', 'label' => $this->__('Country'), 'values' => $this->getHelper('Magento')->getCountries(), 'value' => $address['country_code'], 'required' => true]);
        $fieldset->addField('state', 'text', ['container_id' => 'state_td', 'label' => $this->__('Region/State')]);
        $fieldset->addField('postal_code', 'text', ['name' => 'postal_code', 'label' => $this->__('Zip/Postal Code'), 'value' => $this->getHelper('Data')->escapeHtml($address['postal_code'])]);
        $fieldset->addField('phone', 'text', ['name' => 'phone', 'label' => $this->__('Telephone'), 'value' => $this->getHelper('Data')->escapeHtml($address['phone'])]);
        $form->setUseContainer(true);
        $this->setForm($form);
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Order'));
        $this->jsUrl->add($this->getUrl('*/ebay_order/saveShippingAddress', array('order_id' => $this->getRequest()->getParam('id'))), 'formSubmit');
        $this->js->add("M2ePro.formData.region = '" . $this->getHelper('Data')->escapeJs($regionCode) . "';");
        $this->js->add(<<<JS
    require([
        'M2ePro/Order/Edit/ShippingAddress',
    ], function(){
        window.OrderEditShippingAddressObj = new OrderEditShippingAddress('country_code', 'state_td', 'state');
        OrderEditShippingAddressObj.initObservers();
    });
JS
);
        return parent::_prepareForm();
    }
Example #22
0
    protected function _prepareForm()
    {
        $form = $this->_formFactory->create(['data' => ['id' => 'categories_mode_form', 'method' => 'post']]);
        $fieldset = $form->addFieldset('categories_mode', []);
        $fieldset->addField('block-title', 'label', ['value' => $this->__('You need to choose eBay Categories for Products in order to list them on eBay.'), 'field_extra_attributes' => 'id="categories_mode_block_title" style="font-weight: bold;font-size:18px;margin-bottom:0px"']);
        $this->css->add(<<<CSS
    #categories_mode_block_title .admin__field-control{
        width: 90%;
    }
CSS
);
        $fieldset->addField('block-notice', 'label', ['value' => $this->__('Choose one of the Options below.'), 'field_extra_attributes' => 'style="margin-bottom: 0;"']);
        $fieldset->addField('mode1', 'radios', ['name' => 'mode', 'field_extra_attributes' => 'style="margin: 4px 0 0 0; font-weight: bold"', 'values' => [['value' => 'same', 'label' => 'All Products same Category']], 'note' => '<div style="padding-top: 3px; padding-left: 26px; font-weight: normal">' . $this->__('Products will be Listed using the same eBay Category.') . '</div>']);
        $fieldset->addField('mode_same_remember_checkbox', 'checkbox', ['name' => 'mode_same_remember_checkbox', 'after_element_html' => '&nbsp;&nbsp; <span style="color: #808080; font-size: 1.2rem; vertical-align: top;">' . $this->__('Remember my choice and skip this step in the future.') . '</span>', 'value' => 1, 'checked' => false, 'disabled' => true, 'field_extra_attributes' => 'style="margin-top: 2px; margin-bottom: 0; padding-left: 56px;"']);
        $fieldset->addField('mode2', 'radios', ['name' => 'mode', 'field_extra_attributes' => 'style="margin: 4px 0 0 0; font-weight: bold"', 'values' => [['value' => 'category', 'label' => 'Based on Magento Categories']], 'note' => '<div style="padding-top: 3px; padding-left: 26px; font-weight: normal">' . $this->__('Products will have eBay Categories set according to the Magento Categories.') . '</div>']);
        $fieldset->addField('mode3', 'radios', ['name' => 'mode', 'field_extra_attributes' => 'style="margin: 4px 0 0 0; font-weight: bold"', 'values' => [['value' => 'product', 'label' => 'Get suggested Categories']], 'note' => '<div style="padding-top: 3px; padding-left: 26px; font-weight: normal">' . $this->__('Get eBay to suggest Categories for your Products based on the Title and Magento Attribute set.') . '</div>']);
        $fieldset->addField('mode4', 'radios', ['name' => 'mode', 'field_extra_attributes' => 'style="margin: 4px 0 0 0; font-weight: bold"', 'values' => [['value' => 'manually', 'label' => 'Set Manually for each Product']], 'note' => '<div style="padding-top: 3px; padding-left: 26px; font-weight: normal">' . $this->__('Set eBay Categories for each Product (or a group of Products) manually.') . '</div>']);
        $form->setUseContainer(true);
        $this->setForm($form);
        return parent::_prepareForm();
    }
Example #23
0
    protected function _toHtml()
    {
        $this->jsUrl->addUrls(['formSubmit' => $this->getUrl('m2epro/ebay_marketplace/save'), 'logViewUrl' => $this->getUrl('*/ebay_synchronization_log/index', array('back' => $this->getHelper('Data')->makeBackUrlParam('*/ebay_synchronization/index'))), 'runSynchNow' => $this->getUrl('*/ebay_marketplace/runSynchNow'), 'synchCheckProcessingNow' => $this->getUrl('*/ebay_synchronization/synchCheckProcessingNow')]);
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Ebay\\Marketplace'));
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Ebay\\Category'));
        $this->jsTranslator->addTranslations(['Settings have been saved.' => $this->__('Settings have been saved.'), 'You must select at least one Site you will work with.' => $this->__('You must select at least one Site you will work with.'), '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.'), 'Some eBay Categories were deleted from eBay. Click <a target="_blank" href="%url%">here</a> to check.' => $this->__('Some eBay Categories were deleted from eBay.
                    Click <a target="_blank" href="%url%">here</a> to check.')]);
        $storedStatuses = json_encode($this->storedStatuses);
        $this->js->addOnReadyJs(<<<JS
            require([
                'M2ePro/Marketplace',
                'M2ePro/Ebay/MarketplaceSynchProgress',
                'M2ePro/Plugin/ProgressBar',
                'M2ePro/Plugin/AreaWrapper'
            ], function() {
                window.MarketplaceProgressBarObj = new ProgressBar('marketplaces_progress_bar');
                window.MarketplaceWrapperObj = new AreaWrapper('marketplaces_content_container');

                window.MarketplaceProgressObj =
                    new EbayMarketplaceSynchProgress(MarketplaceProgressBarObj, MarketplaceWrapperObj );
                window.MarketplaceObj = new Marketplace(MarketplaceProgressObj, {$storedStatuses});
                window.MarketplaceProgressObj.initPageCheckState();
            });
JS
);
        return parent::_toHtml();
    }
Example #24
0
 protected function _beforeToHtml()
 {
     $this->jsTranslator->add('Please select Marketplace first.', $this->__('Please select Marketplace first.'));
     return parent::_beforeToHtml();
 }
Example #25
0
    protected function _prepareForm()
    {
        $form = $this->_formFactory->create();
        $attributes = $this->getHelper('Magento\\Attribute')->getGeneralFromAllAttributeSets();
        /** @var $account \Ess\M2ePro\Model\Account */
        $account = $this->getHelper('Data\\GlobalData')->getValue('temp_data');
        $formData = !is_null($account) ? array_merge($account->getData(), $account->getChildObject()->getData()) : [];
        if (isset($formData['other_listings_mapping_settings'])) {
            $formData['other_listings_mapping_settings'] = (array) json_decode($formData['other_listings_mapping_settings'], true);
        }
        if (isset($formData['other_listings_move_settings'])) {
            $formData['other_listings_move_settings'] = (array) json_decode($formData['other_listings_move_settings'], true);
            if (isset($formData['other_listings_move_settings']['synch'])) {
                $formData['other_listings_move_synch'] = $formData['other_listings_move_settings']['synch'];
            }
        }
        $defaults = array('related_store_id' => 0, 'other_listings_synchronization' => Account::OTHER_LISTINGS_SYNCHRONIZATION_YES, 'other_listings_mapping_mode' => Account::OTHER_LISTINGS_MAPPING_MODE_YES, 'other_listings_mapping_settings' => array(), 'other_listings_move_mode' => Account::OTHER_LISTINGS_MOVE_TO_LISTINGS_DISABLED, 'other_listings_move_synch' => Account::OTHER_LISTINGS_MOVE_TO_LISTINGS_SYNCH_MODE_NONE);
        $formData = array_merge($defaults, $formData);
        $isEdit = !!$this->getRequest()->getParam('id');
        $form->addField('amazon_accounts_other_listings', self::HELP_BLOCK, ['content' => $this->__(<<<HTML
<p>This tab of the Account settings contains main configurations for the 3rd Party Listing management. 
You can set preferences whether you would like to import 3rd Party Listings 
(Items that were Listed on eBay either directly on the channel or with the help of other than M2E Pro tool), 
automatically map them to Magento Product, etc..</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/NAItAQ'))]);
        $fieldset = $form->addFieldset('general', ['legend' => $this->__('General'), 'collapsable' => false]);
        $fieldset->addField('other_listings_synchronization', 'select', ['name' => 'other_listings_synchronization', 'label' => $this->__('Import 3rd Party Listings'), 'values' => [Account::OTHER_LISTINGS_SYNCHRONIZATION_YES => $this->__('Yes'), Account::OTHER_LISTINGS_SYNCHRONIZATION_NO => $this->__('No')], 'value' => $formData['other_listings_synchronization'], 'tooltip' => $this->__('Allows importing 3rd Party Listings.')]);
        $fieldset->addField('related_store_id', self::STORE_SWITCHER, ['container_id' => 'marketplaces_related_store_id_container', 'name' => 'related_store_id', 'label' => $this->__('Related Store View'), 'value' => $formData['related_store_id'], 'tooltip' => $this->__('Store View, which will be associated with chosen Marketplace of the current Account.')]);
        $fieldset->addField('other_listings_mapping_mode', 'select', ['container_id' => 'other_listings_mapping_mode_tr', 'name' => 'other_listings_mapping_mode', 'class' => 'M2ePro-require-select-attribute', 'label' => $this->__('Product Mapping'), 'values' => [Account::OTHER_LISTINGS_MAPPING_MODE_YES => $this->__('Yes'), Account::OTHER_LISTINGS_MAPPING_MODE_NO => $this->__('No')], 'value' => $formData['other_listings_mapping_mode'], 'tooltip' => $this->__('Choose whether imported Amazon Listings should automatically map to a 
                    Product in your Magento Inventory.')]);
        $fieldset = $form->addFieldset('magento_block_amazon_accounts_other_listings_product_mapping', ['legend' => $this->__('Magento Product Mapping Settings'), 'collapsable' => false, 'tooltip' => $this->__('<p>In this section you can provide settings for automatic Mapping of the newly imported 
                    3rd Party Listings to the appropriate Magento Products. </p><br>
                    <p>The imported Items are mapped based on the correspondence between Amazon Item values and 
                    Magento Product Attribute values. </p>')]);
        $mappingSettings = $formData['other_listings_mapping_settings'];
        $preparedAttributes = [];
        foreach ($attributes as $attribute) {
            $attrs = ['attribute_code' => $attribute['code']];
            if (isset($mappingSettings['sku']['mode']) && $mappingSettings['sku']['mode'] == Account::OTHER_LISTINGS_MAPPING_SKU_MODE_CUSTOM_ATTRIBUTE && $mappingSettings['sku']['attribute'] == $attribute['code']) {
                $attrs['selected'] = 'selected';
            }
            $preparedAttributes[] = ['attrs' => $attrs, 'value' => Account::OTHER_LISTINGS_MAPPING_SKU_MODE_CUSTOM_ATTRIBUTE, 'label' => $attribute['label']];
        }
        $mappingSkuPriority = isset($mappingSettings['sku']['priority']) ? (int) $mappingSettings['sku']['priority'] : Account::OTHER_LISTINGS_MAPPING_SKU_DEFAULT_PRIORITY;
        $fieldset->addField('mapping_sku_mode', self::SELECT, ['name' => 'mapping_sku_mode', 'label' => $this->__('SKU'), 'class' => 'attribute-mode-select M2ePro-custom-attribute-can-be-created', 'values' => [Account::OTHER_LISTINGS_MAPPING_SKU_MODE_NONE => $this->__('None'), Account::OTHER_LISTINGS_MAPPING_SKU_MODE_DEFAULT => $this->__('Product SKU'), Account::OTHER_LISTINGS_MAPPING_SKU_MODE_PRODUCT_ID => $this->__('Product ID'), ['label' => $this->__('Magento Attributes'), 'value' => $preparedAttributes]], 'value' => isset($mappingSettings['sku']['mode']) && $mappingSettings['sku']['mode'] != Account::OTHER_LISTINGS_MAPPING_SKU_MODE_CUSTOM_ATTRIBUTE ? $mappingSettings['sku']['mode'] : ''])->setAfterElementHtml(<<<HTML
<div id="mapping_sku_priority_td">
    {$this->__('Priority')}: <input style="width: 50px;"
                                    name="mapping_sku_priority"
                                    value="{$mappingSkuPriority}"
                                    type="text"
                                    class="input-text admin__control-text required-entry _required">
</div>
HTML
);
        $fieldset->addField('mapping_sku_attribute', 'hidden', ['name' => 'mapping_sku_attribute', 'value' => isset($mappingSettings['sku']['attribute']) ? $mappingSettings['sku']['attribute'] : '']);
        $modeCustomAttribute = Account::OTHER_LISTINGS_MAPPING_GENERAL_ID_MODE_CUSTOM_ATTRIBUTE;
        $preparedAttributes = [];
        foreach ($attributes as $attribute) {
            $attrs = ['attribute_code' => $attribute['code']];
            if (isset($mappingSettings['general_id']['mode']) && $mappingSettings['general_id']['mode'] == $modeCustomAttribute && $mappingSettings['general_id']['attribute'] == $attribute['code']) {
                $attrs['selected'] = 'selected';
            }
            $preparedAttributes[] = ['attrs' => $attrs, 'value' => Account::OTHER_LISTINGS_MAPPING_GENERAL_ID_MODE_CUSTOM_ATTRIBUTE, 'label' => $attribute['label']];
        }
        $mappingGeneralIdPriority = isset($mappingSettings['general_id']['priority']) ? (int) $mappingSettings['general_id']['priority'] : Account::OTHER_LISTINGS_MAPPING_GENERAL_ID_DEFAULT_PRIORITY;
        $fieldset->addField('mapping_general_id_mode', self::SELECT, ['name' => 'mapping_general_id_mode', 'label' => $this->__('ASIN / ISBN'), 'class' => 'attribute-mode-select M2ePro-custom-attribute-can-be-created', 'values' => [Account::OTHER_LISTINGS_MAPPING_GENERAL_ID_MODE_NONE => $this->__('None'), ['label' => $this->__('Magento Attributes'), 'value' => $preparedAttributes]], 'value' => isset($mappingSettings['general_id']['mode']) && $mappingSettings['general_id']['mode'] != $modeCustomAttribute ? $mappingSettings['general_id']['mode'] : ''])->setAfterElementHtml(<<<HTML
<div id="mapping_general_id_priority_td">
    {$this->__('Priority')}: <input style="width: 50px;"
                                    name="mapping_general_id_priority"
                                    value="{$mappingGeneralIdPriority}"
                                    type="text"
                                    class="input-text admin__control-text required-entry _required">
</div>
HTML
);
        $fieldset->addField('mapping_general_id_attribute', 'hidden', ['name' => 'mapping_general_id_attribute', 'value' => isset($mappingSettings['general_id']['attribute']) ? $mappingSettings['general_id']['attribute'] : '']);
        $preparedAttributes = [];
        foreach ($attributes as $attribute) {
            $attrs = ['attribute_code' => $attribute['code']];
            if (isset($mappingSettings['title']['mode']) && $mappingSettings['title']['mode'] == Account::OTHER_LISTINGS_MAPPING_TITLE_MODE_CUSTOM_ATTRIBUTE && $mappingSettings['title']['attribute'] == $attribute['code']) {
                $attrs['selected'] = 'selected';
            }
            $preparedAttributes[] = ['attrs' => $attrs, 'value' => Account::OTHER_LISTINGS_MAPPING_TITLE_MODE_CUSTOM_ATTRIBUTE, 'label' => $attribute['label']];
        }
        $mappingTitlePriority = isset($mappingSettings['title']['priority']) ? (int) $mappingSettings['title']['priority'] : Account::OTHER_LISTINGS_MAPPING_TITLE_DEFAULT_PRIORITY;
        $fieldset->addField('mapping_title_mode', self::SELECT, ['name' => 'mapping_title_mode', 'label' => $this->__('Listing Title'), 'class' => 'attribute-mode-select M2ePro-custom-attribute-can-be-created', 'values' => [Account::OTHER_LISTINGS_MAPPING_TITLE_MODE_NONE => $this->__('None'), Account::OTHER_LISTINGS_MAPPING_TITLE_MODE_DEFAULT => $this->__('Product Name'), ['label' => $this->__('Magento Attributes'), 'value' => $preparedAttributes]], 'value' => isset($mappingSettings['title']['mode']) && $mappingSettings['title']['mode'] != Account::OTHER_LISTINGS_MAPPING_TITLE_MODE_CUSTOM_ATTRIBUTE ? $mappingSettings['title']['mode'] : ''])->setAfterElementHtml(<<<HTML
<div id="mapping_title_priority_td">
    {$this->__('Priority')}: <input style="width: 50px;"
                                    name="mapping_title_priority"
                                    value="{$mappingTitlePriority}"
                                    type="text"
                                    class="input-text admin__control-text required-entry _required">
</div>
HTML
);
        $fieldset->addField('mapping_title_attribute', 'hidden', ['name' => 'mapping_title_attribute', 'value' => isset($mappingSettings['title']['attribute']) ? $mappingSettings['title']['attribute'] : '']);
        $fieldset = $form->addFieldset('magento_block_amazon_accounts_other_listings_move_mode', ['legend' => $this->__('Auto Moving Mapped Amazon Items To M2E Pro Listings'), 'collapsable' => false]);
        $fieldset->addField('other_listings_move_mode', 'select', ['name' => 'other_listings_move_mode', 'label' => $this->__('Move Mapped Amazon Items'), 'values' => [Account::OTHER_LISTINGS_MOVE_TO_LISTINGS_ENABLED => $this->__('Yes'), Account::OTHER_LISTINGS_MOVE_TO_LISTINGS_DISABLED => $this->__('No')], 'value' => $formData['other_listings_move_mode'], 'tooltip' => $this->__('<p>Enable this option if you would like Amazon Items which have already been Mapped to 
                    Magento Products to be automatically Moved from the 3rd Party Listings to M2E Pro 
                    Listings for further management.</p><br>
                    <p><strong>Note:</strong> Auto Map and Move Actions are performed only during the 
                    first 3rd Party Listing Synchronization. Afterwards, it can be performed manually on 
                    the 3rd Party Listings Page.</p>')]);
        $fieldset->addField('other_listings_move_synch', 'select', ['container_id' => 'other_listings_move_synch_tr', 'name' => 'other_listings_move_synch', 'label' => $this->__('Immediate Synchronization'), 'values' => [Account::OTHER_LISTINGS_MOVE_TO_LISTINGS_SYNCH_MODE_NONE => $this->__('None'), Account::OTHER_LISTINGS_MOVE_TO_LISTINGS_SYNCH_MODE_ALL => $this->__('Price and QTY'), Account::OTHER_LISTINGS_MOVE_TO_LISTINGS_SYNCH_MODE_PRICE => $this->__('Price Only'), Account::OTHER_LISTINGS_MOVE_TO_LISTINGS_SYNCH_MODE_QTY => $this->__('QTY Only')], 'value' => $formData['other_listings_move_synch'], 'tooltip' => $this->__('Updates Price and / or Quantity of Amazon Listing with Magento values.')]);
        $this->setForm($form);
        $this->jsTranslator->add('If Yes is chosen, you must select at least one Attribute for Product Mapping.', $this->__('If Yes is chosen, you must select at least one Attribute for Product Mapping.'));
        return parent::_prepareForm();
    }
Example #26
0
    protected function _toHtml()
    {
        $productsIds = implode(',', $this->getProductsIds());
        $this->js->add(<<<JS
    require([
        'Magento_Ui/js/modal/modal'
    ],function(modal) {

        \$('mode1same').observe('change', function (e) {
            \$('edit_description_template').show();
        });
    
        \$('edit_form').observe('change', function(e) {
            if (e.target.tagName != 'INPUT') {
                return;
            }
    
            if (e.target.value != 'same') {
                \$('edit_description_template').hide();
            } else {
                \$('edit_description_template').show();
            }
        });
    
        createTemplateDescriptionInNewTab = function(stepWindowUrl) {
            var win = window.open(stepWindowUrl);
    
            var intervalId = setInterval(function(){
                if (!win.closed) {
                    return;
                }
    
                clearInterval(intervalId);
    
                loadTemplateDescriptionGrid();
            }, 1000);
        };
    
        loadTemplateDescriptionGrid = function() {
    
            new Ajax.Request(
                '{$this->getUrl('*/amazon_listing_product_template_description/viewTemplateDescriptionsGrid')}', {
                method: 'post',
                parameters: {
                    products_ids : filteredProductsIds,
                    check_is_new_asin_accepted : 1,
                    map_to_template_js_fn : 'selectTemplateDescription'
                },
                onSuccess: function (transport) {
                    \$('template_description_grid').update(transport.responseText);
                    \$('template_description_grid').show();
    
                    var newLink = \$('template_description_addNew_link'),
                        refreshBtn = \$('description_template_refresh_btn');
    
                    if (newLink) {
                        \$('template_description_addNew_link').onclick = function () {
                            createTemplateDescriptionInNewTab(M2ePro.url.get('newTemplateDescriptionUrl'))
                       };
                    }
                    
                    if (refreshBtn) {
                        \$('description_template_refresh_btn').onclick = function () {
                            loadTemplateDescriptionGrid();
                        };
                    }
                }
            })
        };
    
        descriptionTemplateModeFormSubmit = function()
        {
            if (\$('mode1same').checked && \$('description_template_id').value == '') {
                \$('same_description_template_error').show();
                return;
            }
            \$('edit_form').submit();
        };
    
        selectTemplateDescription = function(el, templateId)
        {
            \$('description_template_id').value = templateId;
            \$('products_ids').value = filteredProductsIds;
            \$('description_template_title').innerHTML = el.up('tr').down('td').down('a').innerHTML;
            \$('same_description_template_error').hide();
            popup.modal('closeModal');
        };
    
        var modeElement = \$\$('input[value="{$this->getDescriptionTemplateMode()}"]').shift();
    
        modeElement.checked = true;
        if (modeElement.value != 'same') {
            \$('edit_description_template').hide();
        } else {
            \$('edit_description_template').show();
        }
    
        \$('edit_description_template').observe('click', function(event) {
    
            var popupContent = '';
            new Ajax.Request('{$this->getUrl('*/amazon_listing_product/mapToNewAsin')}', {
                method: 'post',
                parameters: {
                    products_ids : '{$productsIds}'
                },
                onSuccess: function (transport) {
                    if (!transport.responseText.isJSON()) {
                        return;
                    }
    
                    var response = transport.responseText.evalJSON();
    
                    filteredProductsIds = response.products_ids;
                    
                    if (!\$('template_description_pop_up_content')) {
                        \$('html-body').insert({bottom: response.html});
                    }
        
                    popup = jQuery('#template_description_pop_up_content');
        
                    modal({
                        title: '{$this->__('Please select the Description Policy for the process of New ASIN/ISBN creation')}',
                        type: 'slide',
                        buttons: [{
                            text: '{$this->__('Add New Description Policy')}',
                            class: 'action primary ',
                            click: function () {
                                createTemplateDescriptionInNewTab(M2ePro.url.get('newTemplateDescriptionUrl'))
                            }
                        }]
                    }, popup);
        
                    popup.modal('openModal');
            
                    loadTemplateDescriptionGrid();
                }
            });                 
    
        });
    });
JS
);
        return parent::_toHtml();
    }
Example #27
0
    protected function _prepareLayout()
    {
        $form = $this->_formFactory->create();
        $moduleConfig = $this->getHelper('Module')->getConfig();
        $form->addField('cron_job_details', self::HELP_BLOCK, ['no_collapse' => true, 'no_hide' => true, 'content' => $this->__(<<<HTML
                     <p>M2E Pro is an automatic tool for inventory data management on eBay, Amazon, etc.
                     The concept of the Module implies initial configurations which then become the basis 
                     of an automatic operation. Continuous data synchronization is required to ensure the automatic
                     execution of tasks. Frequency of data synchronization is determined by the Cron Job.
                     M2E Pro Synchronization can be run using 2 types of Cron Jobs:</p>
                     <ul>
                     <li><p><strong>M2E Pro Cron Service</strong></p>
                        <p>It is the Cron Job which is used in M2E Pro by default. 
                        This Service was created by M2E Pro Developers specially for Module Clients. 
                        It provides an automatic initialization of M2E Pro Extension via HTTP GET request.</p>
                        <p>This solution has a lot of advantages: users do not need to configure
                        the Magento Cron Job, M2E Pro Synchronization is performed in the same environment 
                        where the Magento admin panel or front-end are working, it prevents the risk of the
                        double synchronization problem (which could be a real issue in the earlier Magento versions)
                        along with other major advantages. Which explains why M2E Pro Cron Service is of a higher 
                        priority as compared to other available options.</p>
                         
                        <p><strong>Considering the fact that M2E Pro Cron Service works over HTTP,
                        it is necessary to ensure that the IP of M2E Pro Cron Service is not blocked
                        by the Firewall or whitelisted on your server. </strong></p>
                        <p>The list of M2E Pro Cron Service IPs is 198.27.83.180, 94.23.53.45</p>
                     </li>
                     <li><p><strong>Magento Cron</strong></p>
                     <p>Magento Cron can be automatically enabled only in case when automatic synchronization
                     cannot be executed via M2E Pro Cron Service (e.g. if M2E Pro Cron Service IP is 
                     blocked by the Firewall of the web-server).</p>
                     <p>This type of Cron Jobs is based on the Magento Cron which can cause various problems,
                     e.g. double synchronization (which is inherent into the earlier Magento versions).</p>
                     <p><strong>To provide proper work of Magento Cron Job,
                     primary correct settings are required.</strong></p>
                     </li>
                     <p>In the list below you can find which Cron Job type is used in your system, 
                     the date of the last synchronization run and notices about the Magento Cron settings 
                     which might be helpful if you need to configure Magento Cron.</p>
                     </ul>
HTML
)]);
        $fieldSet = $form->addFieldset('field_current_status', ['legend' => $this->__('Current Status'), 'collapsable' => false]);
        $fieldSet->addField('current_status_type', 'note', ['label' => $this->__('Type'), 'text' => ucfirst($this->getHelper('Module\\Cron')->getRunner())]);
        if ($this->getHelper('Module\\Cron')->isRunnerService() && !$this->getData('is_support_mode')) {
            $fieldSet->addField('current_status_service_auth_key', 'note', ['label' => $this->__('Service Auth Key'), 'text' => $moduleConfig->getGroupValue('/cron/service/', 'auth_key')]);
        }
        $cronLastRunTime = $this->getHelper('Module\\Cron')->getLastRun();
        if (!is_null($cronLastRunTime)) {
            $this->cronIsNotWorking = $this->getHelper('Module\\Cron')->isLastRunMoreThan(12, true);
        } else {
            $cronLastRunTime = 'N/A';
        }
        $fieldSet->addField('current_status_last_run', 'note', ['label' => $this->__('Last Run'), 'text' => "<span>{$cronLastRunTime}</span>" . ($this->cronIsNotWorking ? '' : ' (' . $this->__('not working') . ')'), 'style' => !$this->cronIsNotWorking ?: 'color: red']);
        if (!$this->getData('is_support_mode') && (bool) (int) $moduleConfig->getGroupValue('/cron/service/', 'disabled')) {
            $fieldSet->addField('current_status_service_cron_state', 'note', ['label' => $this->__('Service Cron State'), 'text' => $this->__('Disabled by Developer'), 'style' => 'color: red']);
        }
        if (!$this->getData('is_support_mode') && (bool) (int) $moduleConfig->getGroupValue('/cron/magento/', 'disabled')) {
            $fieldSet->addField('current_status_magento_cron_state', 'note', ['label' => $this->__('Magento Cron State'), 'text' => $this->__('Disabled by Developer'), 'style' => 'color: red']);
        }
        if ($this->isShownRecommendationsMessage()) {
            $fieldSet = $form->addFieldset('field_setup_instruction', ['legend' => $this->__('Additional'), 'collapsable' => false]);
            $baseDir = $this->getHelper('Client')->getBaseDirectory();
            $fieldSet->addField('setup_instruction_php', 'note', ['label' => $this->__('PHP Command'), 'text' => 'php -q ' . $baseDir . 'cron.php -mdefault 1']);
            $baseUrl = $this->getHelper('Magento')->getBaseUrl();
            $fieldSet->addField('setup_instruction_get', 'note', ['label' => $this->__('GET Command'), 'text' => 'GET ' . $baseUrl . 'cron.php']);
        }
        $fieldSet = $form->addFieldset('field_additional', ['legend' => $this->__('Additional'), 'collapsable' => false]);
        if ($this->isShownServiceDescriptionMessage()) {
            $fieldSet->addField('setup_instruction_service', 'note', ['label' => $this->__('What is the Cron Type Service?'), 'text' => $this->__('It is M2E Pro Cron System where you were registered automatically during the
                        Extension Installation.
                        No additional Settings are required. Our Service does HTTP calls to your Magento from
                        IP address: <b>%server_ip%</b>.', gethostbyname($moduleConfig->getGroupValue('/cron/service/', 'hostname')))]);
        }
        if (!$this->getData('is_support_mode')) {
            $fieldSet->addField('setup_instruction_schedule', 'note', ['label' => $this->__('Cron Schedule Table'), 'text' => "<a href=\"\n                                {$this->getUrl('*/adminhtml_development_inspection/cronScheduleTable')}\n                                \" target=\"_blank\">\n                                {$this->__('Show')}\n                                </a>"]);
        }
        $fieldSet->addField('recommendation_message', 'note', ['text' => '<strong>' . $this->__('We recommend to set up your Magento Cron Job to be run every 1 minute (e.g. * * * * *).') . '</strong>', 'style' => 'text-align: center;']);
        $this->setForm($form);
        return parent::_prepareLayout();
    }
Example #28
0
    protected function _toHtml()
    {
        $this->css->add(<<<CSS
.warning-tooltip {
    display: inline-block;
    width: 40px;
} 
        
.warning-tooltip .admin__field-tooltip .admin__field-tooltip-action:before {
    content: '\\e623';
    display: inline-block;
}      
CSS
);
        $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Model\\Amazon\\Listing'));
        $this->js->add(<<<JS
require([
    'M2ePro/Amazon/Listing/Create/Search'
], function(){

    window.AmazonListingCreateSearchObj = new AmazonListingCreateSearch();

    \$('general_id_mode').observe('change', AmazonListingCreateSearchObj.general_id_mode_change);
    \$('worldwide_id_mode').observe('change', AmazonListingCreateSearchObj.worldwide_id_mode_change);

});
JS
);
        return parent::_toHtml();
    }
Example #29
0
    protected function _prepareForm()
    {
        $account = $this->getHelper('Data\\GlobalData')->getValue('temp_data');
        $websites = $this->getHelper('Magento\\Store\\Website')->getWebsites(true);
        // ---------------------------------------
        // ---------------------------------------
        $temp = $this->customerGroup->getCollection()->toArray();
        $groups = $temp['items'];
        // ---------------------------------------
        // ---------------------------------------
        $productTaxClasses = $this->taxClass->getCollection()->addFieldToFilter('class_type', \Magento\Tax\Model\ClassModel::TAX_CLASS_TYPE_CUSTOMER)->toOptionArray();
        $none = array('value' => \Ess\M2ePro\Model\Magento\Product::TAX_CLASS_ID_NONE, 'label' => $this->__('None'));
        array_unshift($productTaxClasses, $none);
        // ---------------------------------------
        // TODO NOT SUPPORTED FEATURES
        //        $this->isStorePickupEnabled = $account->getChildObject()->isPickupStoreEnabled();
        $formData = !is_null($account) ? array_merge($account->getData(), $account->getChildObject()->getData()) : [];
        $formData['magento_orders_settings'] = !empty($formData['magento_orders_settings']) ? json_decode($formData['magento_orders_settings'], true) : array();
        $defaults = array('magento_orders_settings' => array('listing' => array('mode' => Account::MAGENTO_ORDERS_LISTINGS_MODE_YES, 'store_mode' => Account::MAGENTO_ORDERS_LISTINGS_STORE_MODE_DEFAULT, 'store_id' => NULL), 'listing_other' => array('mode' => Account::MAGENTO_ORDERS_LISTINGS_OTHER_MODE_YES, 'product_mode' => Account::MAGENTO_ORDERS_LISTINGS_OTHER_PRODUCT_MODE_IMPORT, 'product_tax_class_id' => \Ess\M2ePro\Model\Magento\Product::TAX_CLASS_ID_NONE, 'store_id' => NULL), 'number' => array('source' => Account::MAGENTO_ORDERS_NUMBER_SOURCE_MAGENTO, 'prefix' => array('mode' => Account::MAGENTO_ORDERS_NUMBER_PREFIX_MODE_NO, 'prefix' => '')), 'customer' => array('mode' => Account::MAGENTO_ORDERS_CUSTOMER_MODE_GUEST, 'id' => NULL, 'website_id' => NULL, 'group_id' => NULL, 'notifications' => array('invoice_created' => false, 'order_created' => false)), 'creation' => array('mode' => Account::MAGENTO_ORDERS_CREATE_CHECKOUT_AND_PAID, 'reservation_days' => 0), 'tax' => array('mode' => Account::MAGENTO_ORDERS_TAX_MODE_MIXED), 'in_store_pickup_statuses' => array('mode' => 0, 'ready_for_pickup' => '', 'picked_up' => ''), 'status_mapping' => array('mode' => Account::MAGENTO_ORDERS_STATUS_MAPPING_MODE_DEFAULT, 'new' => Account::MAGENTO_ORDERS_STATUS_MAPPING_NEW, 'paid' => Account::MAGENTO_ORDERS_STATUS_MAPPING_PAID, 'shipped' => Account::MAGENTO_ORDERS_STATUS_MAPPING_SHIPPED), 'qty_reservation' => array('days' => 1), 'invoice_mode' => Account::MAGENTO_ORDERS_INVOICE_MODE_YES, 'shipment_mode' => Account::MAGENTO_ORDERS_SHIPMENT_MODE_YES));
        $formData = $this->getHelper('Data')->arrayReplaceRecursive($defaults, $formData);
        $form = $this->_formFactory->create();
        $form->addField('ebay_accounts_orders', self::HELP_BLOCK, ['content' => $this->__(<<<HTML
<p>Specify how M2E Pro should manage the imported from eBay Orders for the Items listed using 
M2E Pro or other tools.</p><br>
<p><strong>Note:</strong> If an eBay Order is received, Magento Product QTY decreases only if a 
Magento Order is created.</p><br>
<p>More detailed information about how to work with this 
Page you can find <a href="%url%" target="_blank">here</a>.</p>
HTML
, $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/LgItAQ'))]);
        $fieldset = $form->addFieldset('listed_by_m2e', ['legend' => $this->__('Product Is Listed By M2E Pro'), 'collapsable' => false]);
        $fieldset->addField('magento_orders_listings_mode', 'select', ['name' => 'magento_orders_settings[listing][mode]', 'label' => $this->__('Create Order in Magento'), 'values' => [Account::MAGENTO_ORDERS_LISTINGS_MODE_YES => $this->__('Yes'), Account::MAGENTO_ORDERS_LISTINGS_MODE_NO => $this->__('No')], 'value' => $formData['magento_orders_settings']['listing']['mode'], 'tooltip' => $this->__('Choose whether a Magento Order should be created if an eBay Order is received for
                    an eBay Item Listed using M2E Pro.')]);
        $fieldset->addField('magento_orders_listings_store_mode', 'select', ['container_id' => 'magento_orders_listings_store_mode_container', 'name' => 'magento_orders_settings[listing][store_mode]', 'label' => $this->__('Magento Store View Source'), 'values' => [Account::MAGENTO_ORDERS_LISTINGS_STORE_MODE_DEFAULT => $this->__('Use Store View from Listing'), Account::MAGENTO_ORDERS_LISTINGS_STORE_MODE_CUSTOM => $this->__('Choose Store View Manually')], 'value' => $formData['magento_orders_settings']['listing']['store_mode'], 'tooltip' => $this->__('Choose to specify the Magento Store View here or to keep the Magento
                    Store View used in the M2E Pro Listing.')]);
        $fieldset->addField('magento_orders_listings_store_id', self::STORE_SWITCHER, ['container_id' => 'magento_orders_listings_store_id_container', 'name' => 'magento_orders_settings[listing][store_id]', 'label' => $this->__('Magento Store View'), 'required' => true, 'value' => $formData['magento_orders_settings']['listing']['store_id'], 'has_empty_option' => true, 'has_default_option' => false, 'tooltip' => $this->__('The Magento Store View that Orders will be placed in.')]);
        $fieldset = $form->addFieldset('listed_by_other', ['legend' => $this->__('Product Is Listed By Any Other Software'), 'collapsable' => false]);
        $fieldset->addField('magento_orders_listings_other_mode', 'select', ['name' => 'magento_orders_settings[listing_other][mode]', 'label' => $this->__('Create Order in Magento'), 'values' => [Account::MAGENTO_ORDERS_LISTINGS_OTHER_MODE_NO => $this->__('No'), Account::MAGENTO_ORDERS_LISTINGS_OTHER_MODE_YES => $this->__('Yes')], 'value' => $formData['magento_orders_settings']['listing_other']['mode'], 'tooltip' => $this->__('Choose whether a Magento Order should be created if an eBay Order is received for
                    an eBay Item <b>not</b> Listed using M2E Pro.')]);
        $fieldset->addField('magento_orders_listings_other_store_id', self::STORE_SWITCHER, ['container_id' => 'magento_orders_listings_other_store_id_container', 'name' => 'magento_orders_settings[listing_other][store_id]', 'label' => $this->__('Magento Store View'), 'required' => true, 'value' => $formData['magento_orders_settings']['listing_other']['store_id'], 'has_empty_option' => false, 'has_default_option' => false, 'tooltip' => $this->__('The Magento Store View that Orders will be placed in.')]);
        $fieldset->addField('magento_orders_listings_other_product_mode', 'select', ['container_id' => 'magento_orders_listings_other_product_mode_container', 'name' => 'magento_orders_settings[listing_other][product_mode]', 'label' => $this->__('Product Not Found'), 'values' => [Account::MAGENTO_ORDERS_LISTINGS_OTHER_PRODUCT_MODE_IGNORE => $this->__('Do Not Create Order'), Account::MAGENTO_ORDERS_LISTINGS_OTHER_PRODUCT_MODE_IMPORT => $this->__('Create Product and Order')], 'value' => $formData['magento_orders_settings']['listing_other']['product_mode'], 'tooltip' => $this->__('Choose what should happen if an Order is received for a Product that
                         does not exist in your Magento Inventory.') . '<span id="magento_orders_listings_other_product_mode_note">' . $this->__('<br/><b>Note:</b> Only Simple Products without Variations can be created in Magento.
                            If there is a Product with Variations on eBay, M2E Pro creates different
                            Simple Products for each Variation.') . '</span>']);
        $values = [];
        foreach ($productTaxClasses as $taxClass) {
            $values[$taxClass['value']] = $taxClass['label'];
        }
        $fieldset->addField('magento_orders_listings_other_product_tax_class_id', 'select', ['container_id' => 'magento_orders_listings_other_product_tax_class_id_container', 'name' => 'magento_orders_settings[listing_other][product_tax_class_id]', 'label' => $this->__('Product Tax Class'), 'values' => $values, 'value' => $formData['magento_orders_settings']['listing_other']['product_tax_class_id'], 'tooltip' => $this->__('Tax Class which will be used for Products created by M2E Pro.')]);
        $fieldset = $form->addFieldset('magento_block_ebay_accounts_magento_orders_number', ['legend' => $this->__('Magento Order Number'), 'collapsable' => true]);
        $fieldset->addField('magento_orders_number_source', 'select', ['name' => 'magento_orders_settings[number][source]', 'label' => $this->__('Source'), 'values' => [Account::MAGENTO_ORDERS_NUMBER_SOURCE_MAGENTO => $this->__('Magento'), Account::MAGENTO_ORDERS_NUMBER_SOURCE_CHANNEL => $this->__('eBay')], 'value' => $formData['magento_orders_settings']['number']['source'], 'tooltip' => $this->__('If source is set to Magento, Magento Order numbers are created basing on your Magento Settings.
                    If source is set to eBay, Magento Order numbers are the same as eBay Order numbers.')]);
        $fieldset->addField('magento_orders_number_prefix_mode', 'select', ['name' => 'magento_orders_settings[number][prefix][mode]', 'label' => $this->__('Use Prefix'), 'values' => [Account::MAGENTO_ORDERS_NUMBER_PREFIX_MODE_NO => $this->__('No'), Account::MAGENTO_ORDERS_NUMBER_PREFIX_MODE_YES => $this->__('Yes')], 'value' => $formData['magento_orders_settings']['number']['prefix']['mode'], 'tooltip' => $this->__('Choose to set prefix before Magento Order number.')]);
        $fieldset->addField('magento_orders_number_prefix_prefix', 'text', ['container_id' => 'magento_orders_number_prefix_container', 'class' => 'M2ePro-account-order-number-prefix', 'name' => 'magento_orders_settings[number][prefix][prefix]', 'label' => $this->__('Prefix'), 'value' => $formData['magento_orders_settings']['number']['prefix']['prefix'], 'required' => true, 'maxlength' => 5]);
        $fieldset->addField('sample_magento_order_id', 'hidden', ['value' => $this->getHelper('Magento')->getNextMagentoOrderId()]);
        $fieldset->addField('sample_ebay_order_id', 'hidden', ['value' => '110194096334-27192305001']);
        $fieldset->addField('order_number_example', 'label', ['label' => '', 'note' => $this->__('e.g.') . ' <span id="order_number_example_container"></span>']);
        $fieldset = $form->addFieldset('magento_block_ebay_accounts_magento_orders_customer', ['legend' => $this->__('Customer Settings'), 'collapsable' => true]);
        $fieldset->addField('magento_orders_customer_mode', 'select', ['name' => 'magento_orders_settings[customer][mode]', 'label' => $this->__('Customer'), 'values' => [Account::MAGENTO_ORDERS_CUSTOMER_MODE_GUEST => $this->__('Guest Account'), Account::MAGENTO_ORDERS_CUSTOMER_MODE_PREDEFINED => $this->__('Predefined Customer'), Account::MAGENTO_ORDERS_CUSTOMER_MODE_NEW => $this->__('Create New')], 'value' => $formData['magento_orders_settings']['customer']['mode'], 'tooltip' => $this->__('<b>Guest Account:</b> Magento Guest Checkout Option must be enabled to use this Option.
                    Use the default Guest Account. Do not create a Customer Account.<br/><br/>
                    <b>Predefined Customer:</b> Use a specific Customer for all Orders.
                    You should specify the Magento Customer ID to use.<br/><br/>
                    <b>Create New:</b> Create a new Customer in Magento for the Order.
                    If an existing Magento Customer has the same email address as the email address used for the
                    eBay Order, the Order will be assigned to that Customer instead.')]);
        $fieldset->addField('magento_orders_customer_id', 'text', ['container_id' => 'magento_orders_customer_id_container', 'class' => 'validate-digits M2ePro-account-customer-id', 'name' => 'magento_orders_settings[customer][id]', 'label' => $this->__('Customer ID'), 'value' => $formData['magento_orders_settings']['customer']['id'], 'required' => true]);
        $values = [];
        foreach ($websites as $website) {
            $values[$website['website_id']] = $website['name'];
        }
        $fieldset->addField('magento_orders_customer_new_website_id', 'select', ['container_id' => 'magento_orders_customer_new_website_id_container', 'name' => 'magento_orders_settings[customer][website_id]', 'label' => $this->__('Associate to Website'), 'values' => $values, 'value' => $formData['magento_orders_settings']['customer']['website_id'], 'required' => true]);
        $values = [];
        foreach ($groups as $group) {
            $values[$group['customer_group_id']] = $group['customer_group_code'];
        }
        $fieldset->addField('magento_orders_customer_new_group_id', 'select', ['container_id' => 'magento_orders_customer_new_group_id_container', 'name' => 'magento_orders_settings[customer][group_id]', 'label' => $this->__('Customer Group'), 'values' => $values, 'value' => $formData['magento_orders_settings']['customer']['group_id'], 'required' => true]);
        $value = [];
        $formData['magento_orders_settings']['customer']['notifications']['order_created'] && ($value[] = 'order_created');
        $formData['magento_orders_settings']['customer']['notifications']['invoice_created'] && ($value[] = 'invoice_created');
        $fieldset->addField('magento_orders_customer_new_notifications', 'multiselect', ['container_id' => 'magento_orders_customer_new_notifications_container', 'name' => 'magento_orders_settings[customer][notifications][]', 'label' => $this->__('Send Emails When The Following Is Created'), 'values' => [['label' => $this->__('Magento Order'), 'value' => 'order_created'], ['label' => $this->__('Invoice'), 'value' => 'invoice_created']], 'value' => $value, 'tooltip' => $this->__('<p>Necessary emails will be sent according to Magento Settings in 
                    Stores > Configuration > Sales > Sales Emails.</p>
                    <p>Hold Ctrl Button to choose more than one Option.</p>')]);
        $fieldset = $form->addFieldset('magento_block_ebay_accounts_magento_orders_rules', ['legend' => $this->__('Order Creation Rules'), 'collapsable' => true]);
        $fieldset->addField('magento_orders_creation_mode', 'select', ['name' => 'magento_orders_settings[creation][mode]', 'label' => $this->__('Create Magento Order When'), 'values' => [Account::MAGENTO_ORDERS_CREATE_IMMEDIATELY => $this->__('Immediately'), Account::MAGENTO_ORDERS_CREATE_CHECKOUT => $this->__('Checkout Is Completed'), Account::MAGENTO_ORDERS_CREATE_PAID => $this->__('Payment Is Received'), Account::MAGENTO_ORDERS_CREATE_CHECKOUT_AND_PAID => $this->__('Checkout Is Completed & Payment Received')], 'value' => $formData['magento_orders_settings']['creation']['mode'], 'tooltip' => $this->__('Choose the stage of the eBay Order process at which the Magento Order should be created.
                     You can also choose for how long to reserve Stock as soon as an eBay Order is received,
                     to ensure you can fulfil the eBay Order in case there is a delay between the Order being made
                     and the Magento Order being created.')]);
        $values = [0 => $this->__('Never')];
        for ($day = 7; $day <= 10; $day++) {
            $values[$day] = $this->__('In %d% days', $day);
        }
        $fieldset->addField('magento_orders_creation_reservation_days', 'select', ['container_id' => 'magento_orders_creation_reservation_days_container', 'name' => 'magento_orders_settings[creation][reservation_days]', 'label' => $this->__('Automatic Cancellation'), 'values' => $values, 'value' => $formData['magento_orders_settings']['creation']['reservation_days'], 'tooltip' => $this->__('Magento Orders, which were not paid in a definite time interval,
                    will be cancelled. Unpaid Item Process will be launched for such Orders on eBay.')]);
        $values = [];
        for ($day = 1; $day <= 14; $day++) {
            if ($day == 1) {
                $values[$day] = $this->__('For %number% day', $day);
            } else {
                $values[$day] = $this->__('For %number% days', $day);
            }
        }
        $fieldset->addField('magento_orders_qty_reservation_days', 'select', ['container_id' => 'magento_orders_qty_reservation_days_container', 'name' => 'magento_orders_settings[qty_reservation][days]', 'label' => $this->__('Reserve Quantity'), 'values' => $values, 'value' => $formData['magento_orders_settings']['qty_reservation']['days'], 'tooltip' => $this->__('Choose how long to set Stock aside after an eBay Order is made,
                    to allow time for the eBay process to reach the point at which a Magento Order is created.')]);
        $fieldset = $form->addFieldset('magento_block_ebay_accounts_magento_orders_tax', ['legend' => $this->__('Order Tax Settings'), 'collapsable' => true]);
        $fieldset->addField('magento_orders_tax_mode', 'select', ['name' => 'magento_orders_settings[tax][mode]', 'label' => $this->__('Tax Source'), 'values' => [Account::MAGENTO_ORDERS_TAX_MODE_NONE => $this->__('None'), Account::MAGENTO_ORDERS_TAX_MODE_CHANNEL => $this->__('eBay'), Account::MAGENTO_ORDERS_TAX_MODE_MAGENTO => $this->__('Magento'), Account::MAGENTO_ORDERS_TAX_MODE_MIXED => $this->__('eBay & Magento')], 'value' => $formData['magento_orders_settings']['tax']['mode'], 'tooltip' => $this->__('Choose the Tax Settings for your Magento Order:
                    <br/>
                    <br/><b>eBay</b> - Magento Orders use Tax Settings from the eBay Listing.
                    <br/><b>Magento</b> - Magento Orders use Magento Tax Settings.
                    <br/><b>eBay & Magento</b> - Magento Orders use Tax Settings from the eBay Listing.
                    If there are no Tax Settings set in eBay, Magento Tax Settings are used.
                    <br/><b>None</b> - No Tax Settings are set.')]);
        $fieldset = $form->addFieldset('magento_block_ebay_accounts_magento_orders_status_mapping', ['legend' => $this->__('Order Status Mapping'), 'collapsable' => true]);
        $fieldset->addField('magento_orders_status_mapping_mode', 'select', ['name' => 'magento_orders_settings[status_mapping][mode]', 'label' => $this->__('Status Mapping'), 'values' => [Account::MAGENTO_ORDERS_STATUS_MAPPING_MODE_DEFAULT => $this->__('Default Order Statuses'), Account::MAGENTO_ORDERS_STATUS_MAPPING_MODE_CUSTOM => $this->__('Custom Order Statuses')], 'value' => $formData['magento_orders_settings']['status_mapping']['mode'], 'tooltip' => $this->__('Match stages in the eBay Order process to Order Statuses in Magento.
                     You can also choose whether to create invoices and shipment notifications automatically.')]);
        $isDisabledStatus = $formData['magento_orders_settings']['status_mapping']['mode'] == Account::MAGENTO_ORDERS_STATUS_MAPPING_MODE_DEFAULT;
        if ($formData['magento_orders_settings']['status_mapping']['mode'] == Account::MAGENTO_ORDERS_STATUS_MAPPING_MODE_DEFAULT) {
            $formData['magento_orders_settings']['status_mapping']['new'] = Account::MAGENTO_ORDERS_STATUS_MAPPING_NEW;
            $formData['magento_orders_settings']['status_mapping']['paid'] = Account::MAGENTO_ORDERS_STATUS_MAPPING_PAID;
            $formData['magento_orders_settings']['status_mapping']['shipped'] = Account::MAGENTO_ORDERS_STATUS_MAPPING_SHIPPED;
            $formData['magento_orders_settings']['invoice_mode'] = Account::MAGENTO_ORDERS_INVOICE_MODE_YES;
            $formData['magento_orders_settings']['shipment_mode'] = Account::MAGENTO_ORDERS_SHIPMENT_MODE_YES;
        }
        $statusList = $this->orderConfig->getStatuses();
        $fieldset->addField('magento_orders_status_mapping_new', 'select', ['name' => 'magento_orders_settings[status_mapping][new]', 'label' => $this->__('Checkout Is Completed'), 'values' => $statusList, 'value' => $formData['magento_orders_settings']['status_mapping']['new'], 'disabled' => $isDisabledStatus]);
        $invoiceModeDisabled = $isDisabledStatus ? 'disabled="disabled"' : '';
        $invoiceModeChecked = $formData['magento_orders_settings']['status_mapping']['mode'] == Account::MAGENTO_ORDERS_STATUS_MAPPING_MODE_DEFAULT || $formData['magento_orders_settings']['invoice_mode'] == Account::MAGENTO_ORDERS_INVOICE_MODE_YES ? 'checked="checked"' : '';
        $fieldset->addField('magento_orders_status_mapping_paid', 'select', ['container_id' => 'magento_orders_status_mapping_paid_container', 'name' => 'magento_orders_settings[status_mapping][paid]', 'label' => $this->__('Payment Is Completed'), 'values' => $statusList, 'value' => $formData['magento_orders_settings']['status_mapping']['paid'], 'disabled' => $isDisabledStatus])->setAfterElementHtml(<<<HTML
<label for="magento_orders_invoice_mode">
<input id="magento_orders_invoice_mode"
       name="magento_orders_settings[invoice_mode]"
       type="checkbox" {$invoiceModeChecked} {$invoiceModeDisabled}> {$this->__('Automatic Invoice Creation')}</label>
HTML
);
        $shipmentModeDisabled = $isDisabledStatus ? 'disabled="disabled"' : '';
        $shipmentModeChecked = $formData['magento_orders_settings']['status_mapping']['mode'] == Account::MAGENTO_ORDERS_STATUS_MAPPING_MODE_DEFAULT || $formData['magento_orders_settings']['shipment_mode'] == Account::MAGENTO_ORDERS_SHIPMENT_MODE_YES ? 'checked="checked"' : '';
        $fieldset->addField('magento_orders_status_mapping_shipped', 'select', ['container_id' => 'magento_orders_status_mapping_shipped_container', 'name' => 'magento_orders_settings[status_mapping][shipped]', 'label' => $this->__('Shipping Is Completed'), 'values' => $statusList, 'value' => $formData['magento_orders_settings']['status_mapping']['shipped'], 'disabled' => $isDisabledStatus])->setAfterElementHtml(<<<HTML
<label for="magento_orders_shipment_mode">
<input id="magento_orders_shipment_mode"
       name="magento_orders_settings[shipment_mode]"
       type="checkbox" {$shipmentModeChecked} {$shipmentModeDisabled}> {$this->__('Automatic Shipment Creation')}</label>
HTML
);
        $this->setForm($form);
        $formData['magento_orders_settings']['listing']['mode'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['listing']['mode']);
        $formData['magento_orders_settings']['listing']['store_mode'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['listing']['store_mode']);
        $formData['magento_orders_settings']['listing']['store_id'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['listing']['store_id']);
        $formData['magento_orders_settings']['listing_other']['mode'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['listing_other']['mode']);
        $formData['magento_orders_settings']['listing_other']['store_id'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['listing_other']['store_id']);
        $formData['magento_orders_settings']['listing_other']['product_mode'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['listing_other']['product_mode']);
        $formData['magento_orders_settings']['customer']['mode'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['customer']['mode']);
        $formData['magento_orders_settings']['customer']['id'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['customer']['id']);
        $formData['magento_orders_settings']['customer']['website_id'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['customer']['website_id']);
        $formData['magento_orders_settings']['customer']['group_id'] = $this->getHelper('Data')->escapeJs($formData['magento_orders_settings']['customer']['group_id']);
        $this->js->add(<<<JS

    M2ePro.formData.magento_orders_listings_mode = "{$formData['magento_orders_settings']['listing']['mode']}";
    M2ePro.formData.magento_orders_listings_store_mode
        = "{$formData['magento_orders_settings']['listing']['store_mode']}";
    M2ePro.formData.magento_orders_listings_store_id
        = "{$formData['magento_orders_settings']['listing']['store_id']}";

    M2ePro.formData.magento_orders_listings_other_mode
        = "{$formData['magento_orders_settings']['listing_other']['mode']}";
    M2ePro.formData.magento_orders_listings_other_store_id
        = "{$formData['magento_orders_settings']['listing_other']['store_id']}";
    M2ePro.formData.magento_orders_listings_other_product_mode
        = "{$formData['magento_orders_settings']['listing_other']['product_mode']}";

    M2ePro.formData.magento_orders_customer_mode = "{$formData['magento_orders_settings']['customer']['mode']}";
    M2ePro.formData.magento_orders_customer_id = "{$formData['magento_orders_settings']['customer']['id']}";
    M2ePro.formData.magento_orders_customer_new_website_id
        = "{$formData['magento_orders_settings']['customer']['website_id']}";
    M2ePro.formData.magento_orders_customer_new_group_id
        = "{$formData['magento_orders_settings']['customer']['group_id']}";

JS
);
        return parent::_prepareForm();
    }
Example #30
0
 protected function _beforeToHtml()
 {
     $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Model\\Amazon\\Template\\Description\\Definition'));
     return parent::_beforeToHtml();
 }