protected function _beforeToHtml() { // --------------------------------------- /** @var Ess_M2ePro_Model_Marketplace[] $marketplaces */ $marketplaces = Mage::helper('M2ePro/Component_Amazon')->getCollection('Marketplace')->setOrder('group_title', 'ASC')->setOrder('sorder', 'ASC')->setOrder('title', 'ASC')->getItems(); $resultMarketplaces = array(); $storedStatuses = array(); $canadaMarketplace = NULL; $canadaStoreStatus = NULL; foreach ($marketplaces as $marketplace) { if (is_null($marketplace->getData('developer_key'))) { continue; } $isLocked = (bool) Mage::helper('M2ePro/Component_Amazon')->getCollection('Account')->addFieldToFilter('marketplace_id', $marketplace->getId())->getSize(); if ($marketplace->getId() == 24 && $marketplace->getCode() == 'CA') { $canadaMarketplace = array('instance' => $marketplace, 'params' => array('locked' => $isLocked)); $canadaStoreStatus = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus()); continue; } $storedStatuses[] = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus()); $resultMarketplaces[] = array('instance' => $marketplace, 'params' => array('locked' => $isLocked)); } if (!is_null($canadaMarketplace) && !is_null($canadaStoreStatus)) { $storedStatuses[] = $canadaStoreStatus; $resultMarketplaces[] = $canadaMarketplace; } $this->marketplaces = $resultMarketplaces; $this->storedStatuses = $storedStatuses; // --------------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //---------------------------- $marketplaces = array(); $marketplaces[Ess_M2ePro_Helper_Component_Buy::NICK] = Mage::helper('M2ePro/Component_Buy')->getCollection('Marketplace')->getFirstItem(); $marketplaces[Ess_M2ePro_Helper_Component_Play::NICK] = Mage::helper('M2ePro/Component_Play')->getCollection('Marketplace')->getFirstItem(); $activeWizard = $this->getActiveWizard(); if (!is_null($activeWizard)) { $marketplaces = array($marketplaces[$activeWizard]); } $groups = array(); $previewGroup = ''; $idGroup = 1; foreach ($marketplaces as $marketplace) { if ($marketplace->getGroupTitle() != $previewGroup) { $previewGroup = $marketplace->getGroupTitle(); $groups[] = array('id' => $idGroup, 'title' => $previewGroup, 'marketplaces' => array()); $idGroup++; } $marketplace = array('instance' => $marketplace, 'params' => array('locked' => $marketplace->isLocked())); $groups[count($groups) - 1]['marketplaces'][] = $marketplace; } $this->groups = $groups; //---------------------------- //------------------------------ $data = array('label' => Mage::helper('M2ePro')->__('Update Now'), 'onclick' => 'MarketplaceHandlerObj.runSingleMarketplaceSynchronization(this)', 'class' => 'run_single_button'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('run_single_button', $buttonBlock); //------------------------------ return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------ $attributesSets = Mage::helper('M2ePro/Magento')->getAttributeSets(); $this->setData('attributes_sets', $attributesSets); //------------------------------ //------------------------------ $this->attribute_set_locked = false; if (Mage::helper('M2ePro')->getGlobalValue('temp_data') && Mage::helper('M2ePro')->getGlobalValue('temp_data')->getId()) { $this->attribute_set_locked = Mage::helper('M2ePro')->getGlobalValue('temp_data')->isLocked(); } $this->listing_type_locked = $this->attribute_set_locked; //------------------------------ //------------------------------ $this->setData('currencies', Mage::helper('M2ePro/Module')->getConfig()->getAllGroupValues('/ebay/currency/', Ess_M2ePro_Model_Config_Abstract::SORT_VALUE_ASC)); //------------------------------ //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_select_all_button', 'label' => Mage::helper('M2ePro')->__('Select All'), 'onclick' => 'AttributeSetHandlerObj.selectAllAttributeSets();', 'class' => 'attribute_sets_select_all_button')); $this->setChild('attribute_sets_select_all_button', $buttonBlock); //------------------------------ //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_confirm_button', 'label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'EbayTemplateSellingFormatHandlerObj.attribute_sets_confirm();', 'class' => 'attribute_sets_confirm_button', 'style' => 'display: none')); $this->setChild('attribute_sets_confirm_button', $buttonBlock); //------------------------------ //------------------------------ $this->customerGroups = Mage::getModel('customer/group')->getCollection()->toOptionArray(); //------------------------------ return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------ $unsortedCountries = Mage::getModel('directory/country_api')->items(); $unsortedCountriesNames = array(); foreach ($unsortedCountries as $country) { $unsortedCountriesNames[] = $country['name']; } sort($unsortedCountriesNames, SORT_STRING); $sortedCountries = array(); foreach ($unsortedCountriesNames as $name) { foreach ($unsortedCountries as $country) { if ($country['name'] == $name) { $sortedCountries[] = $country; break; } } } $this->setData('countries', $sortedCountries); //------------------------------ $buyerEmail = $this->order->getData('buyer_email'); stripos($buyerEmail, 'Invalid Request') !== false && ($buyerEmail = ''); $this->setData('buyer_email', $buyerEmail); $this->setData('buyer_name', $this->order->getData('buyer_name')); $this->setData('address', $this->order->getShippingAddress()->getData()); $this->setData('region_code', $this->order->getShippingAddress()->getRegionCode()); return parent::_beforeToHtml(); }
protected function _beforeToHtml() { $ruleModel = Mage::helper('M2ePro/Data_Global')->getValue('rule_model'); $ruleBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_magento_product_rule')->setData(array('rule_model' => $ruleModel)); $this->setChild('rule_block', $ruleBlock); return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // Set data for form //---------------------------- $this->component_ebay_mode = Mage::helper('M2ePro/Component_Ebay')->isActive(); $this->component_amazon_mode = Mage::helper('M2ePro/Component_Amazon')->isActive(); $this->component_buy_mode = Mage::helper('M2ePro/Component_Buy')->isActive(); $this->component_ebay_allowed = Mage::helper('M2ePro/Component_Ebay')->isAllowed(); $this->component_amazon_allowed = Mage::helper('M2ePro/Component_Amazon')->isAllowed(); $this->component_buy_allowed = Mage::helper('M2ePro/Component_Buy')->isAllowed(); $this->component_group_rakuten_allowed = Mage::helper('M2ePro/Component')->isRakutenAllowed(); $this->components_allowed_count = count(Mage::helper('M2ePro/Component')->getAllowedComponents()); $this->component_default = Mage::helper('M2ePro/Component')->getDefaultComponent(); $this->products_show_thumbnails = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/products/settings/', 'show_thumbnails'); $this->block_notices_show = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/block_notices/settings/', 'show'); $this->feedbacks_notification_mode = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/feedbacks/notification/', 'mode'); $this->messages_notification_mode = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/messages/notification/', 'mode'); $this->cron_notification_mode = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/cron/notification/', 'mode'); //---------------------------- //------------------------------- $url = $this->getUrl('*/*/restoreBlockNotices'); $confirm = Mage::helper('M2ePro')->__('Are you sure?'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Restore All Helps'), 'onclick' => 'confirmSetLocation(\'' . $confirm . '\', \'' . $url . '\')', 'class' => 'restore_block_notices')); $this->setChild('restore_block_notices', $buttonBlock); //------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // Magento order data // --------------- $this->real_magento_order_id = NULL; if (!is_null($magentoOrderId = $this->order->getData('magento_order_id'))) { $magentoOrder = Mage::getModel('sales/order')->load($magentoOrderId); if ($magentoOrder->getId()) { $this->real_magento_order_id = $magentoOrder->getRealOrderId(); } } // --------------- // Shipping data // --------------- $this->shipping_address = NULL; $shippingAddress = $this->order->getShippingAddress(true); if (count($shippingAddress)) { if (isset($shippingAddress['country_id']) && $shippingAddress['country_id'] != '') { $country = Mage::getModel('directory/country')->load($shippingAddress['country_id']); !is_null($country->getId()) && ($shippingAddress['country_id'] = $country->getName()); } $this->shipping_address = $shippingAddress; } // --------------- $this->setChild('order_items', $this->getLayout()->createBlock('M2ePro/adminhtml_orders_view_items')); $this->setChild('order_logs', $this->getLayout()->createBlock('M2ePro/adminhtml_orders_view_logs')); $this->setChild('order_external_transactions', $this->getLayout()->createBlock('M2ePro/adminhtml_orders_view_external')); return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------ $attributesSets = Mage::helper('M2ePro/Magento_AttributeSet')->getAll(); $this->setData('attributes_sets', $attributesSets); //------------------------------ //------------------------------ $this->attribute_set_locked = false; if (Mage::helper('M2ePro/Data_Global')->getValue('temp_data') && Mage::helper('M2ePro/Data_Global')->getValue('temp_data')->getId()) { $this->attribute_set_locked = Mage::helper('M2ePro/Data_Global')->getValue('temp_data')->isLocked(); } //------------------------------ //------------------------------ $this->setData('currencies', Mage::helper('M2ePro/Component_Amazon')->getCurrencies()); //------------------------------ //------------------------------ $data = array('id' => 'attribute_sets_select_all_button', 'label' => Mage::helper('M2ePro')->__('Select All'), 'onclick' => 'AttributeSetHandlerObj.selectAllAttributeSets();', 'class' => 'attribute_sets_select_all_button'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('attribute_sets_select_all_button', $buttonBlock); //------------------------------ //------------------------------ $data = array('id' => 'attribute_sets_confirm_button', 'label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'AmazonTemplateSellingFormatHandlerObj.attribute_sets_confirm();', 'class' => 'attribute_sets_confirm_button', 'style' => 'display: none'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('attribute_sets_confirm_button', $buttonBlock); //------------------------------ //------------------------------ $this->customerGroups = Mage::getModel('customer/group')->getCollection()->toOptionArray(); //------------------------------ return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------ $attributesSets = Mage::getModel('eav/entity_attribute_set')->getCollection()->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())->setOrder('attribute_set_name', 'ASC')->toArray(); $this->setData('attributes_sets', $attributesSets['items']); //------------------------------ //------------------------------ $this->attribute_set_locked = false; if (Mage::registry('M2ePro_data') && Mage::registry('M2ePro_data')->getId()) { $this->attribute_set_locked = Mage::registry('M2ePro_data')->isLocked(); } //------------------------------ //------------------------------ $this->setData('currencies', Mage::helper('M2ePro/Module')->getConfig()->getAllGroupValues('/ebay/currency/', Ess_M2ePro_Model_ConfigBase::SORT_VALUE_ASC)); //------------------------------ //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_select_all_button', 'label' => Mage::helper('M2ePro')->__('Select All'), 'onclick' => 'AttributeSetsHandlersObj.selectAllAttributeSets();', 'class' => 'attribute_sets_select_all_button')); $this->setChild('attribute_sets_select_all_button', $buttonBlock); //------------------------------ //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_confirm_button', 'label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'SellingFormatTemplatesHandlersObj.attribute_sets_confirm();', 'class' => 'attribute_sets_confirm_button', 'style' => 'display: none')); $this->setChild('attribute_sets_confirm_button', $buttonBlock); //------------------------------ return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------- $this->isFromError = $this->getRequest()->getParam('error') === 'true'; //------------------------------- //------------------------------- $cronInfoBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_development_inspection_cron', '', array('is_support_mode' => true)); $this->setChild('cron_info', $cronInfoBlock); //------------------------------- //------------------------------- $systemRequirementsBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_development_inspection_requirements', '', array('is_support_mode' => true)); $this->setChild('system_requirements', $systemRequirementsBlock); //------------------------------- //------------------------------- $data = array('label' => Mage::helper('M2ePro')->__('Search'), 'onclick' => 'SupportHandlerObj.searchUserVoiceData();', 'id' => 'send_button'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('user_voice_search', $buttonBlock); //------------------------------- //------------------------------- $data = array('label' => Mage::helper('M2ePro')->__('Contact Support'), 'onclick' => 'SupportHandlerObj.forceShowContactSupportForm();', 'id' => 'force_show_contact_support_button'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('force_show_contact_support_button', $buttonBlock); //------------------------------- //------------------------------- $tabsBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_support_tabs', '', array('is_from_error' => $this->isFromError)); $this->setChild('tabs', $tabsBlock); //------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // --------------------------------------- /** @var Ess_M2ePro_Model_Marketplace[] $marketplaces */ $marketplaces = array(); $marketplaces[Ess_M2ePro_Helper_Component_Buy::NICK] = Mage::helper('M2ePro/Component_Buy')->getCollection('Marketplace')->getFirstItem(); $groups = array(); $storedStatuses = array(); $previewGroup = ''; $idGroup = 1; foreach ($marketplaces as $component => $marketplace) { if ($marketplace->getGroupTitle() != $previewGroup) { $previewGroup = $marketplace->getGroupTitle(); $groups[] = array('id' => $idGroup, 'title' => $previewGroup, 'marketplaces' => array()); $idGroup++; } $storedStatuses[] = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus()); $isLocked = (bool) Mage::helper('M2ePro/Component_' . ucfirst($component))->getCollection('Account')->getSize(); $marketplace = array('instance' => $marketplace, 'params' => array('locked' => $isLocked)); $groups[count($groups) - 1]['marketplaces'][] = $marketplace; } $this->groups = $groups; $this->storedStatuses = $storedStatuses; // --------------------------------------- // --------------------------------------- $data = array('label' => Mage::helper('M2ePro')->__('Update Now'), 'onclick' => 'MarketplaceHandlerObj.runSingleSynchronization(this)', 'class' => 'run_single_button'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('run_single_button', $buttonBlock); // --------------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { $configModel = Mage::helper('M2ePro/Module')->getConfig(); $this->view_ebay_mode = $configModel->getGroupValue('/view/ebay/', 'mode'); $this->view_ebay_feedbacks_notification_mode = (bool) (int) $configModel->getGroupValue('/view/ebay/feedbacks/notification/', 'mode'); $this->use_last_specifics_mode = (bool) (int) $configModel->getGroupValue('/view/ebay/template/category/', 'use_last_specifics'); $this->check_the_same_product_already_listed_mode = (bool) (int) $configModel->getGroupValue('/ebay/connector/listing/', 'check_the_same_product_already_listed'); /** @var Ess_M2ePro_Helper_Component_Ebay_Motor_Compatibility $compatibilityHelper */ $compatibilityHelper = Mage::helper('M2ePro/Component_Ebay_Motor_Compatibility'); // ------------------------ /** @var Ess_M2ePro_Model_Mysql4_Marketplace_Collection $specificsMarketplaceCollection */ $specificsMarketplaceCollection = Mage::getModel('M2ePro/Marketplace')->getCollection(); $specificsMarketplaceCollection->addFieldToFilter('id', array('in' => $compatibilityHelper->getSpecificSupportedMarketplaces())); $specificsMarketplaceCollection->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE); $this->is_motors_specifics_marketplace_enabled = (bool) $specificsMarketplaceCollection->getSize(); // ------------------------ // ------------------------ /** @var Ess_M2ePro_Model_Mysql4_Marketplace_Collection $ktypeMarketplaceCollection */ $ktypeMarketplaceCollection = Mage::getModel('M2ePro/Marketplace')->getCollection(); $ktypeMarketplaceCollection->addFieldToFilter('id', array('in' => $compatibilityHelper->getKtypeSupportedMarketplaces())); $ktypeMarketplaceCollection->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE); $this->is_motors_ktypes_marketplace_enabled = (bool) $ktypeMarketplaceCollection->getSize(); // ------------------------ $attributesForPartsCompatibility = Mage::getResourceModel('catalog/product_attribute_collection')->addVisibleFilter()->addFieldToFilter('backend_type', array('eq' => 'text'))->addFieldToFilter('frontend_input', array('eq' => 'textarea'))->toArray(); $this->attributes_for_parts_compatibility = $attributesForPartsCompatibility['items']; $this->motors_specifics_attribute = $configModel->getGroupValue('/ebay/motor/', 'motors_specifics_attribute'); $this->motors_ktypes_attribute = $configModel->getGroupValue('/ebay/motor/', 'motors_ktypes_attribute'); return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // --------------------------------------- $this->setData('source', $this->getRequest()->getParam('source', 'products')); // --------------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { $chooserBlockData = Mage::helper('M2ePro/Data_Global')->getValue('chooser_data'); // --------------------------------------------------- /** @var Ess_M2ePro_Block_Adminhtml_Ebay_Listing_Category_Chooser $chooserBlock */ $chooserBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_category_chooser'); $chooserBlock->setMarketplaceId($chooserBlockData['marketplace']); if (in_array($chooserBlockData['type'], Mage::helper('M2ePro/Component_Ebay_Category')->getStoreCategoryTypes())) { $chooserBlock->setAccountId($chooserBlockData['account']); } $chooserBlock->setSingleCategoryMode(); $chooserBlock->setSingleCategoryType($chooserBlockData['type']); $chooserBlock->setSingleCategoryData(array('mode' => $chooserBlockData['mode'], 'value' => $chooserBlockData['value'], 'path' => $chooserBlockData['path'])); $this->setChild('chooser_block', $chooserBlock); // --------------------------------------------------- // --------------------------------------------------- if (in_array($chooserBlockData['type'], Mage::helper('M2ePro/Component_Ebay_Category')->getEbayCategoryTypes())) { $marketplaceTitle = Mage::helper('M2ePro/Component_Ebay')->getCachedObject('Marketplace', (int) $chooserBlockData['marketplace'])->getTitle(); $this->marketplaceData = array('title' => $marketplaceTitle); } else { $accountTitle = Mage::helper('M2ePro/Component_Ebay')->getCachedObject('Account', (int) $chooserBlockData['account'])->getTitle(); $this->accountData = array('id' => $chooserBlockData['account'], 'title' => $accountTitle); } // --------------------------------------------------- //------------------------------ $this->setChild('confirm', $this->getLayout()->createBlock('M2ePro/adminhtml_widget_dialog_confirm')); //------------------------------ return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //---------------------------- $this->inspectorMode = Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/synchronization/settings/defaults/inspector/', 'mode'); //---------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //---------------------------- $marketplaces = Mage::helper('M2ePro/Component_Amazon')->getCollection('Marketplace')->setOrder('group_title', 'ASC')->setOrder('sorder', 'ASC')->setOrder('title', 'ASC')->getItems(); $groups = array(); $storedStatuses = array(); $previewGroup = ''; $idGroup = 1; foreach ($marketplaces as $marketplace) { if ($marketplace->getGroupTitle() != $previewGroup) { $previewGroup = $marketplace->getGroupTitle(); $groups[] = array('id' => $idGroup, 'title' => $previewGroup, 'marketplaces' => array()); $idGroup++; } $storedStatuses[] = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus()); $marketplace = array('instance' => $marketplace, 'params' => array('locked' => $marketplace->isLocked())); $groups[count($groups) - 1]['marketplaces'][] = $marketplace; } $this->groups = $groups; $this->storedStatuses = $storedStatuses; //---------------------------- //------------------------------ $data = array('label' => Mage::helper('M2ePro')->__('Update Now'), 'onclick' => 'MarketplaceHandlerObj.runSingleSynchronization(this)', 'class' => 'run_single_button'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('run_single_button', $buttonBlock); //------------------------------ return parent::_beforeToHtml(); }
protected function _beforeToHtml() { /** @var $connRead Varien_Db_Adapter_Pdo_Mysql */ $connRead = Mage::getSingleton('core/resource')->getConnection('core_read'); $this->nodes = $connRead->select()->from(Mage::getSingleton('core/resource')->getTableName('m2epro_buy_dictionary_category'))->where('parent_id = ?', 0)->query()->fetchAll(); //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'category_confirm_button', 'label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'BuyTemplateNewProductHandlerObj.confirmCategory();')); $this->setChild('category_confirm_button', $buttonBlock); //------------------------------ //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'category_change_button', 'label' => Mage::helper('M2ePro')->__('Change Category'), 'onclick' => 'BuyTemplateNewProductHandlerObj.changeCategory();')); $this->setChild('category_change_button', $buttonBlock); //------------------------------ //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'category_cancel_button', 'label' => Mage::helper('M2ePro')->__('Cancel'), 'onclick' => 'BuyTemplateNewProductHandlerObj.cancelCategory();')); $this->setChild('category_cancel_button', $buttonBlock); //------------------------------ $attributesSets = Mage::helper('M2ePro/Magento')->getAttributeSets(); $this->setData('attributes_sets', $attributesSets); $temp = Mage::helper('M2ePro')->getGlobalValue('temp_data'); $this->attribute_set_locked = false; if (!is_null($temp)) { $this->attribute_set_locked = (bool) Mage::getModel('M2ePro/Buy_Listing_Product')->getCollection()->addFieldToFilter('template_new_product_id', $temp['category']['id'])->getSize(); } //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_select_all_button', 'label' => Mage::helper('M2ePro')->__('Select All'), 'onclick' => 'AttributeSetHandlerObj.selectAllAttributeSets();', 'class' => 'attribute_sets_select_all_button')); $this->setChild('attribute_sets_select_all_button', $buttonBlock); //------------------------------ //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_confirm_button', 'label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'BuyTemplateNewProductHandlerObj.confirmAttributeSets();', 'class' => 'attribute_sets_confirm_button', 'style' => 'display: none')); $this->setChild('attribute_sets_confirm_button', $buttonBlock); //------------------------------ return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // --------------------------------------- $this->setData('source', $this->getRequest()->getParam('source', Ess_M2ePro_Model_Listing::SOURCE_PRODUCTS_CUSTOM)); // --------------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // Set data for form //---------------------------- $status['mode'] = Mage::getModel('M2ePro/License_Model')->getMode(); $status['status'] = Mage::getModel('M2ePro/License_Model')->getStatus(); $status['key'] = Mage::helper('M2ePro')->escapeHtml(Mage::getModel('M2ePro/License_Model')->getKey()); $status['expired_date'] = Mage::getModel('M2ePro/License_Model')->getTextExpiredDate(); $this->status = $status; $valid['component'] = Mage::getModel('M2ePro/License_Model')->getComponent(); $valid['domain'] = Mage::getModel('M2ePro/License_Model')->getDomain(); $valid['ip'] = Mage::getModel('M2ePro/License_Model')->getIp(); $valid['directory'] = Mage::getModel('M2ePro/License_Model')->getDirectory(); $this->valid = $valid; //---------------------------- //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Refresh'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/refreshStatus') . '\');', 'class' => 'refresh_status')); $this->setChild('refresh_status', $buttonBlock); //------------------------------- //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Enter'), 'onclick' => 'LicenseHandlersObj.changeLicenseKey();', 'class' => 'enter_key')); $this->setChild('enter_key', $buttonBlock); //------------------------------- //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Change'), 'onclick' => 'LicenseHandlersObj.changeLicenseKey();', 'class' => 'change_key')); $this->setChild('change_key', $buttonBlock); //------------------------------- //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'LicenseHandlersObj.save_click(\'' . $this->getUrl('*/*/confirmKey') . '\');', 'class' => 'confirm_key')); $this->setChild('confirm_key', $buttonBlock); //------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // --------------------------------------- /** @var Ess_M2ePro_Model_Marketplace[] $marketplaces */ $marketplaces = Mage::helper('M2ePro/Component_Amazon')->getCollection('Marketplace')->setOrder('group_title', 'ASC')->setOrder('sorder', 'ASC')->setOrder('title', 'ASC')->getItems(); $groups = array(); $storedStatuses = array(); $idGroup = 1; $groupsOrder = array('america' => 'America', 'europe' => 'Europe', 'asia_pacific' => 'Asia / Pacific'); foreach ($groupsOrder as $key => $groupOrderTitle) { $groups[$key] = array('id' => $idGroup++, 'title' => $groupOrderTitle, 'marketplaces' => array()); foreach ($marketplaces as $marketplace) { if ($marketplace->getGroupTitle() != $groupOrderTitle) { continue; } $storedStatuses[] = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus()); $isLocked = (bool) Mage::helper('M2ePro/Component_Amazon')->getCollection('Account')->addFieldToFilter('marketplace_id', $marketplace->getId())->getSize(); $marketplace = array('instance' => $marketplace, 'params' => array('locked' => $isLocked)); $groups[$key]['marketplaces'][] = $marketplace; } } $this->groups = $groups; $this->storedStatuses = $storedStatuses; // --------------------------------------- // --------------------------------------- $data = array('label' => Mage::helper('M2ePro')->__('Update Now'), 'onclick' => 'MarketplaceHandlerObj.runSingleSynchronization(this)', 'class' => 'run_single_button'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('run_single_button', $buttonBlock); // --------------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------- $data = array('label' => Mage::helper('M2ePro')->__('Send'), 'onclick' => 'EbayFeedbackHandlerObj.sendFeedback();', 'class' => 'send_feedback'); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); $this->setChild('send_feedback', $buttonBlock); //------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { if (is_object($this->getEditedEntity()) && is_array($this->getEditedValue())) { $this->_canDisplay = true; return parent::_beforeToHtml(); } else { $this->_canDisplay = false; return $this; } }
protected function _beforeToHtml() { $this->setData('buyer_name', $this->order->getData('buyer_name')); $this->setData('buyer_email', $this->order->getData('buyer_email')); $this->setData('address', $this->order->getShippingAddress()->getData()); $this->setData('region_code', $this->order->getShippingAddress()->getRegionCode()); $this->setData('company', $this->order->getChildObject()->getBillingAddress()->getData('company')); $this->setData('phone', $this->order->getChildObject()->getBillingAddress()->getData('phone')); return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // --------------------------------------- $this->attributes = Mage::helper('M2ePro/Magento_Attribute')->getGeneralFromAllAttributeSets(); // --------------------------------------- // --------------------------------------- $this->customerGroups = Mage::getModel('customer/group')->getCollection()->toOptionArray(); // --------------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Cancel'), 'onclick' => 'ConfigHandlersObj.cancelEdit();', 'class' => 'cancel_edit')); $this->setChild('cancel_edit', $buttonBlock); $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Save'), 'onclick' => 'ConfigHandlersObj.saveConfig();', 'class' => 'save_form')); $this->setChild('save_form', $buttonBlock); //------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { parent::_beforeToHtml(); // --------------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('onclick' => 'AmazonTemplateShippingOverrideHandlerObj.addRow();', 'class' => 'add add_shipping_override_rule_button')); $this->setChild('add_shipping_override_rule_button', $buttonBlock); // --------------------------------------- // --------------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Remove'), 'onclick' => 'AmazonTemplateShippingOverrideHandlerObj.removeRow(this);', 'class' => 'delete icon-btn remove_shipping_override_rule_button')); $this->setChild('remove_shipping_override_rule_button', $buttonBlock); // --------------------------------------- }
protected function _beforeToHtml() { //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Send'), 'onclick' => 'EbayMessageHandlerObj.sendMessage();', 'class' => 'send_message')); $this->setChild('send_message', $buttonBlock); //------------------------------- //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Cancel'), 'onclick' => 'EbayMessageHandlerObj.cancelMessage();', 'class' => 'cancel_message')); $this->setChild('cancel_message', $buttonBlock); //------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Attach Another File'), 'onclick' => 'SupportHandlerObj.moreAttachments();', 'class' => 'more_attachments')); $this->setChild('more_attachments', $buttonBlock); //------------------------------- //------------------------------- $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => ' ' . Mage::helper('M2ePro')->__('Send Message') . ' ', 'onclick' => 'SupportHandlerObj.save_click();', 'class' => 'send_form')); $this->setChild('send_form', $buttonBlock); //------------------------------- return parent::_beforeToHtml(); }
protected function _beforeToHtml() { //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'display_product_description', 'label' => Mage::helper('M2ePro')->__('View'), 'type' => 'submit')); $this->setChild('display_product_description', $buttonBlock); //------------------------------ //------------------------------ $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'display_random_product_description', 'label' => Mage::helper('M2ePro')->__('View Random Product'), 'type' => 'submit', 'onclick' => '$(\'product_id\').value = \'\'; return true;')); $this->setChild('display_random_product_description', $buttonBlock); //------------------------------ return parent::_beforeToHtml(); }
protected function _beforeToHtml() { // --------------------------------------- /** @var Ess_M2ePro_Model_Marketplace[] $marketplaces */ $marketplaces = Mage::helper('M2ePro/Component_Buy')->getCollection('Marketplace')->setOrder('group_title', 'ASC')->setOrder('sorder', 'ASC')->setOrder('title', 'ASC')->getItems(); $storedStatuses = array(); foreach ($marketplaces as $marketplace) { $storedStatuses[] = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus(), 'marketplace_title' => $marketplace->getTitle(), 'component_title' => Mage::helper('M2ePro/Component_Buy')->getTitle()); } $this->storedStatuses = $storedStatuses; // --------------------------------------- return parent::_beforeToHtml(); }