Esempio n. 1
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     // ---------------------------------------
     $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $this->getHelper('Data\\GlobalData')->getValue('review_listing')]]);
     $this->setChild('view_header', $viewHeaderBlock);
     // ---------------------------------------
     // ---------------------------------------
     $url = $this->getUrl('*/ebay_listing/view', array('id' => $this->getRequest()->getParam('id')));
     $buttonBlock = $this->createBlock('Magento\\Button')->setData(array('label' => $this->__('Go To The Listing'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'primary'));
     $this->setChild('review', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $addedProductsIds = $this->getHelper('Data\\Session')->getValue('added_products_ids');
     $url = $this->getUrl('*/ebay_listing/previewItems', array('currentProductId' => $addedProductsIds[0], 'productIds' => implode(',', $addedProductsIds)));
     $buttonBlock = $this->createBlock('Magento\\Button')->setData(array('label' => $this->__('Preview Added Products Now'), 'onclick' => 'window.open(\'' . $url . '\').focus();', 'class' => 'primary go'));
     $this->setChild('preview', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $url = $this->getUrl('*/ebay_listing/view', array('id' => $this->getRequest()->getParam('id'), 'do_list' => true));
     $buttonBlock = $this->createBlock('Magento\\Button')->setData(array('label' => $this->__('List Added Products Now'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'primary'));
     $this->getRequest()->getParam('disable_list', false) && $buttonBlock->setData('style', 'display: none');
     $this->setChild('save_and_list', $buttonBlock);
     // ---------------------------------------
 }
Esempio n. 2
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     // ---------------------------------------
     $listing = $this->getHelper('Data\\GlobalData')->getValue('listing_for_products_category_settings');
     $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $listing]]);
     $this->setChild('view_header', $viewHeaderBlock);
     // ---------------------------------------
     // ---------------------------------------
     $categoryMode = $this->getData('category_mode');
     $categoryValue = $this->getData('category_value');
     $internalData = $this->getData('internal_data');
     $specifics = $this->getData('specifics');
     $specificBlock = $this->createBlock('Ebay\\Listing\\Product\\Category\\Settings\\Specific');
     $specificBlock->setMarketplaceId($listing['marketplace_id']);
     $specificBlock->setCategoryMode($categoryMode);
     $specificBlock->setCategoryValue($categoryValue);
     if (!empty($internalData)) {
         $specificBlock->setInternalData($internalData);
     }
     if (!empty($specifics)) {
         $specificBlock->setSelectedSpecifics($specifics);
     }
     $this->setChild('category_specific', $specificBlock);
     // ---------------------------------------
     // ---------------------------------------
     if ($categoryMode == \Ess\M2ePro\Model\Ebay\Template\Category::CATEGORY_MODE_EBAY) {
         $this->_selectedCategoryPath = $this->getHelper('Component\\Ebay\\Category\\Ebay')->getPath($categoryValue, $listing['marketplace_id']);
     } else {
         $attributeLabel = $this->getHelper('Magento\\Attribute')->getAttributeLabel($categoryValue);
         $this->_selectedCategoryPath = $this->__('Magento Attribute') . ' > ' . $attributeLabel;
     }
     // ---------------------------------------
 }
Esempio n. 3
0
    protected function _beforeToHtml()
    {
        if ($this->isNewAsin()) {
            $helpBlock = $this->createBlock('HelpBlock')->setData(['content' => $this->__('
    For New ASIN/ISBN Creation you should select a prepared Description Policy,
    where New ASIN/ISBN Creation feature is obviously <strong>Enabled</strong>.<br/>
    If Description Policy cannot be assigned you will see a reason why it cannot become a base for
    New ASIN/ISBN Creation in <strong>Status/Reason</strong> Column.<br/><br/>

    <strong>Note:</strong> you can always add new Description Policy by pressing Add New
    Description Policy Button.<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/uYgVAQ'))]);
        } else {
            $helpBlock = $this->createBlock('HelpBlock')->setData(['content' => $this->__('
    Description Policy is using to update Amazon Product Information, such as Title, Images, etc.
    It can be assigned to already existed Products.<br/><br/>

    <strong>Note:</strong> To create New ASIN/ISBN you should not only assign
    Description Policy to your Products, but provide Settings for New ASIN/ISBN Creation.
    You can do it in two ways:<br/>
    <ul class="list">
    <li>using an <strong>Assign Settings for New ASIN/ISBN</strong>
    Option in Actions bulk at the top of the Grid;</li>
    <li>clicking on a Plus Icon in <strong>ASIN/ISBN Column</strong>
    of a Grid and selecting an <strong>Assign Settings for New ASIN/ISBN</strong> Option in an opened pop-up.</li>
    </ul>')]);
        }
        $this->setChild('help_block', $helpBlock);
        return parent::_beforeToHtml();
    }
Esempio n. 4
0
 protected function _beforeToHtml()
 {
     $this->setChild('product_mapping_grid', $this->createBlock('Order\\Item\\Product\\Mapping\\Grid'));
     $this->setChild('product_mapping_help_block', $this->createBlock('HelpBlock')->setData(['content' => $this->__('As M2E Pro was not able to find appropriate Product in Magento Catalog,
                  you are supposed to find and map it manualy.
                  <br/><br/><b>Note:</b> Magento Order can be only created when all Products of
                  Order are found in Magento Catalog.')]));
     return parent::_beforeToHtml();
 }
Esempio n. 5
0
 protected function _beforeToHtml()
 {
     // ---------------------------------------
     $data = array('id' => 'productSearch_submit_button', 'label' => $this->__('Search'), 'class' => 'productSearch_submit_button submit action primary');
     $buttonSubmitBlock = $this->createBlock('Magento\\Button')->setData($data);
     $this->setChild('productSearch_submit_button', $buttonSubmitBlock);
     // ---------------------------------------
     parent::_beforeToHtml();
 }
Esempio n. 6
0
 protected function _beforeToHtml()
 {
     // Magento order data
     // ---------------------------------------
     $this->realMagentoOrderId = NULL;
     $magentoOrder = $this->order->getMagentoOrder();
     if (!is_null($magentoOrder)) {
         $this->realMagentoOrderId = $magentoOrder->getRealOrderId();
     }
     // ---------------------------------------
     $data = array('class' => 'primary', 'label' => $this->__('Edit'), 'onclick' => "OrderEditItemObj.openEditShippingAddressPopup({$this->order->getId()});");
     $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
     $this->setChild('edit_shipping_info', $buttonBlock);
     // ---------------------------------------
     if (!is_null($magentoOrder) && $magentoOrder->hasShipments() && !$this->order->getChildObject()->isPrime()) {
         $url = $this->getUrl('*/order/resubmitShippingInfo', array('id' => $this->order->getId()));
         $data = array('class' => 'primary', 'label' => $this->__('Resend Shipping Information'), 'onclick' => 'setLocation(\'' . $url . '\');');
         $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
         $this->setChild('resubmit_shipping_info', $buttonBlock);
     }
     // ---------------------------------------
     // Shipping data
     // ---------------------------------------
     /** @var $shippingAddress \Ess\M2ePro\Model\Amazon\Order\ShippingAddress */
     $shippingAddress = $this->order->getShippingAddress();
     $this->shippingAddress = $shippingAddress->getData();
     $this->shippingAddress['country_name'] = $shippingAddress->getCountryName();
     // ---------------------------------------
     // TODO NOT SUPPORTED FEATURES
     // Merchant Fulfillment
     // ---------------------------------------
     //        if (!$this->order->getChildObject()->isCanceled()
     //            && !$this->order->getChildObject()->isPending()
     //            && !$this->order->getChildObject()->isFulfilledByAmazon()
     //            && $this->order->getMarketplace()->getChildObject()->isMerchantFulfillmentAvailable()) {
     //            $orderId = $this->order->getId();
     //            $data = array(
     //                'class'   => '',
     //                'label'   => $this->__('Use Amazon\'s Shipping Services'),
     //                'onclick' => "OrderMerchantFulfillmentObj.getPopupAction({$orderId});",
     //                'style'   => 'margin-top: 3px; margin-left: 6px;'
     //            );
     //            $buttonBlock = $this->getLayout()->createBlock('Magento\Button')->setData($data);
     //            $this->setChild('use_amazons_shipping_services', $buttonBlock);
     //        }
     // ---------------------------------------
     $this->jsUrl->addUrls(['order/getDebugInformation' => $this->getUrl('*/order/getDebugInformation/', array('id' => $this->getRequest()->getParam('id'))), 'getEditShippingAddressForm' => $this->getUrl('*/amazon_order_shippingAddress/edit/', array('id' => $this->getRequest()->getParam('id'))), 'saveShippingAddress' => $this->getUrl('*/amazon_order_shippingAddress/save', array('id' => $this->getRequest()->getParam('id')))]);
     $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Controller\\Adminhtml\\Order\\EditItem'));
     $this->setChild('shipping_address', $this->createBlock('Amazon\\Order\\Edit\\ShippingAddress'));
     $this->setChild('item', $this->createBlock('Amazon\\Order\\View\\Item'));
     $this->setChild('item_edit', $this->createBlock('Order\\Item\\Edit'));
     $this->setChild('log', $this->createBlock('Order\\View\\Log\\Grid'));
     return parent::_beforeToHtml();
 }
Esempio n. 7
0
 protected function _beforeToHtml()
 {
     // ---------------------------------------
     $data = array('id' => 'failedProducts_continue_button', 'label' => $this->__('Continue'), 'class' => 'submit');
     $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
     $this->setChild('failedProducts_continue_button', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $data = array('id' => 'failedProducts_back_button', 'label' => $this->__('Back'), 'class' => 'scalable back');
     $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
     $this->setChild('failedProducts_back_button', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $this->setChild('failedProducts_grid', $this->createBlock('Listing\\Moving\\FailedProducts\\Grid', '', array('grid_url' => $this->getData('grid_url'))));
     // ---------------------------------------
     parent::_beforeToHtml();
 }
Esempio n. 8
0
 protected function _beforeToHtml()
 {
     // Magento order data
     // ---------------------------------------
     $this->realMagentoOrderId = NULL;
     $magentoOrder = $this->order->getMagentoOrder();
     if (!is_null($magentoOrder)) {
         $this->realMagentoOrderId = $magentoOrder->getRealOrderId();
     }
     // ---------------------------------------
     $data = array('class' => 'primary', 'label' => $this->__('Edit'), 'onclick' => "OrderEditItemObj.openEditShippingAddressPopup({$this->order->getId()});");
     $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
     $this->setChild('edit_shipping_info', $buttonBlock);
     // ---------------------------------------
     if (!is_null($magentoOrder) && $magentoOrder->hasShipments()) {
         $url = $this->getUrl('*/order/resubmitShippingInfo', array('id' => $this->order->getId()));
         $data = array('label' => $this->__('Resend Shipping Information'), 'onclick' => 'setLocation(\'' . $url . '\');');
         $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
         $this->setChild('resubmit_shipping_info', $buttonBlock);
     }
     // ---------------------------------------
     // Shipping data
     // ---------------------------------------
     /** @var $shippingAddress \Ess\M2ePro\Model\Ebay\Order\ShippingAddress */
     $shippingAddress = $this->order->getShippingAddress();
     $this->shippingAddress = $shippingAddress->getData();
     $this->shippingAddress['country_name'] = $shippingAddress->getCountryName();
     // ---------------------------------------
     // Global Shipping data
     // ---------------------------------------
     $globalShippingDetails = $this->order->getChildObject()->getGlobalShippingDetails();
     if (!empty($globalShippingDetails)) {
         $this->ebayWarehouseAddress = $globalShippingDetails['warehouse_address'];
         $this->globalShippingServiceDetails = $globalShippingDetails['service_details'];
     }
     // ---------------------------------------
     $this->setChild('shipping_address', $this->createBlock('Ebay\\Order\\Edit\\ShippingAddress'));
     $this->setChild('item', $this->createBlock('Ebay\\Order\\View\\Item'));
     $this->setChild('item_edit', $this->createBlock('Order\\Item\\Edit'));
     $this->setChild('log', $this->createBlock('Order\\View\\Log\\Grid'));
     $this->setChild('external_transaction', $this->createBlock('Ebay\\Order\\View\\ExternalTransaction'));
     $this->jsUrl->addUrls(['order/getDebugInformation' => $this->getUrl('*/order/getDebugInformation/', array('id' => $this->getRequest()->getParam('id'))), 'getEditShippingAddressForm' => $this->getUrl('*/ebay_order_shippingAddress/edit', array('id' => $this->getRequest()->getParam('id'))), 'saveShippingAddress' => $this->getUrl('*/ebay_order_shippingAddress/save', array('id' => $this->getRequest()->getParam('id')))]);
     $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Controller\\Adminhtml\\Order\\EditItem'));
     return parent::_beforeToHtml();
 }
Esempio n. 9
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     // ---------------------------------------
     $listing = $this->getHelper('Data\\GlobalData')->getValue('listing_for_products_add');
     $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $listing]]);
     $this->setChild('view_header', $viewHeaderBlock);
     // ---------------------------------------
     // ---------------------------------------
     $url = $this->getUrl('*/*/viewListing', array('_current' => true, 'id' => $this->getRequest()->getParam('id')));
     $buttonBlock = $this->createBlock('Magento\\Button')->setData(array('label' => $this->__('Go To The Listing'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'action primary'));
     $this->setChild('review', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $url = $this->getUrl('*/*/viewListingAndList', array('_current' => true, 'id' => $this->getRequest()->getParam('id')));
     $buttonBlock = $this->createBlock('Magento\\Button')->setData(array('label' => $this->__('List Added Products Now'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'action primary'));
     $this->setChild('list', $buttonBlock);
     // ---------------------------------------
 }
Esempio n. 10
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     // ---------------------------------------
     $listing = $this->getHelper('Data\\GlobalData')->getValue('listing_for_products_category_settings');
     $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $listing]]);
     $this->setChild('view_header', $viewHeaderBlock);
     // ---------------------------------------
     // ---------------------------------------
     $data = array('id' => 'next_category_button', 'class' => 'action primary next_category_button specifics_buttons', 'label' => $this->__('Next Category'), 'onclick' => 'EbayListingProductCategorySettingsSpecificWrapperObj.renderNextCategory();');
     $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
     $this->setChild('next_category_button', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $data = array('class' => 'action primary continue specifics_buttons forward', 'label' => $this->__('Continue'), 'onclick' => 'EbayListingProductCategorySettingsSpecificWrapperObj.save();');
     $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
     $this->setChild('continue', $buttonBlock);
     // ---------------------------------------
 }
Esempio n. 11
0
    protected function _beforeToHtml()
    {
        $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Helper\\Module\\Wizard'));
        $this->jsUrl->addUrls(['setStep' => $this->getUrl('*/wizard_' . $this->getNick() . '/setStep'), 'setStatus' => $this->getUrl('*/wizard_' . $this->getNick() . '/setStatus')]);
        $this->jsTranslator->addTranslations(['Step' => $this->__('Step'), 'Note: If you close the Wizard, it never starts again. You will be required to set all Settings manually.
            Press Cancel to continue working with Wizard.' => $this->__('Note: If you close the Wizard, it never starts again.
                You will be required to set all Settings manually. Press Cancel to continue working with Wizard.'), 'Completed' => $this->__('Completed')]);
        $step = $this->getHelper('Module\\Wizard')->getStep($this->getNick());
        $steps = json_encode($this->getHelper('Module\\Wizard')->getWizard($this->getNick())->getSteps());
        $status = $this->getHelper('Module\\Wizard')->getStatus($this->getNick());
        $this->js->add(<<<JS
    require([
        'M2ePro/Wizard',
    ], function(){
        window.WizardObj = new Wizard('{$status}', '{$step}');
        WizardObj.steps.all = {$steps};
    });
JS
);
        return parent::_beforeToHtml();
    }
Esempio n. 12
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     //
     //        // ---------------------------------------
     //        $data = array(
     //            'label' => $this->__('Yes'),
     //            'id'    => 'existing_templates_confirm_button'
     //        );
     //        $this->setChild(
     //            'existing_templates_confirm_button',
     //            $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data)
     //        );
     //        // ---------------------------------------
     //        $data = array(
     //            'label' => $this->__('No'),
     //            'id'    => 'existing_templates_cancel_button'
     //        );
     //        $this->setChild(
     //            'existing_templates_cancel_button',
     //            $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data)
     //        );
     //        // ---------------------------------------
 }
Esempio n. 13
0
 protected function _beforeToHtml()
 {
     // ---------------------------------------
     $channelOptions = array();
     foreach ($this->getOrderItem()->getChildObject()->getVariationChannelOptions() as $attribute => $value) {
         $channelOptions[] = array('label' => $attribute, 'value' => $value);
     }
     $this->setData('channel_options', $channelOptions);
     // ---------------------------------------
     // ---------------------------------------
     $this->magentoProduct = $this->getOrderItem()->getMagentoProduct();
     $magentoOptions = array();
     $magentoVariations = $this->magentoProduct->getVariationInstance()->getVariationsTypeRaw();
     if ($this->magentoProduct->isGroupedType()) {
         $magentoOptionLabel = $this->__(\Ess\M2ePro\Model\Magento\Product\Variation::GROUPED_PRODUCT_ATTRIBUTE_LABEL);
         $magentoOption = array('option_id' => 0, 'label' => $magentoOptionLabel, 'values' => array());
         foreach ($magentoVariations as $key => $magentoVariation) {
             $magentoOption['values'][] = array('value_id' => $key, 'label' => $magentoVariation->getName(), 'product_ids' => array($magentoVariation->getId()));
         }
         $magentoOptions[] = $magentoOption;
     } else {
         foreach ($magentoVariations as $magentoVariation) {
             $magentoOptionLabel = array_shift($magentoVariation['labels']);
             if (!$magentoOptionLabel) {
                 $magentoOptionLabel = $this->__('N/A');
             }
             $magentoOption = array('option_id' => $magentoVariation['option_id'], 'label' => $magentoOptionLabel, 'values' => array());
             foreach ($magentoVariation['values'] as $magentoOptionValue) {
                 $magentoValueLabel = array_shift($magentoOptionValue['labels']);
                 if (!$magentoValueLabel) {
                     $magentoValueLabel = $this->__('N/A');
                 }
                 $magentoOption['values'][] = array('value_id' => $magentoOptionValue['value_id'], 'label' => $magentoValueLabel, 'product_ids' => $magentoOptionValue['product_ids']);
             }
             $magentoOptions[] = $magentoOption;
         }
     }
     $this->setData('magento_options', $magentoOptions);
     // ---------------------------------------
     $this->setChild('product_mapping_options_help_block', $this->createBlock('HelpBlock')->setData(['content' => $this->__('As M2E Pro was not able to find appropriate Option in Magento Product you are supposed
                 find and Map it manualy.
                 <br/>If you want to use the same Settings for the similar subsequent Orders,
                 select appropriate check-box at the bottom.
                 <br/><br/><b>Note:</b> Magento Order can be only created when all Products of Order are
                 found in Magento Catalog.')]));
     $this->setChild('product_mapping_options_out_of_stock_message', $this->getLayout()->createBlock('Magento\\Framework\\View\\Element\\Messages')->addWarning($this->__('Selected Product Option is Out of Stock.')));
     parent::_beforeToHtml();
 }