public function __construct(array $params = array(), Ess_M2ePro_Model_Listing $listing) { $defaultParams = array('status_changer' => Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_UNKNOWN); $params = array_merge($defaultParams, $params); $this->listing = $listing; parent::__construct($params, $this->listing->getMarketplace(), $this->listing->getAccount(), NULL); }
public function __construct(array $params = array(), Ess_M2ePro_Model_Listing $listing) { $defaultParams = array('status_changer' => Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_UNKNOWN); $params = array_merge($defaultParams, $params); if (isset($params['logs_action_id'])) { $this->logsActionId = (int) $params['logs_action_id']; unset($params['logs_action_id']); } else { $this->logsActionId = Mage::getModel('M2ePro/Listing_Log')->getNextActionId(); } $this->listing = $listing; parent::__construct($params, $this->listing->getMarketplace(), $this->listing->getAccount(), NULL); }
protected function _prepareMassaction() { $this->setMassactionIdField('listing_product_id'); $this->setMassactionIdFieldOnlyIndexValue(true); //-------------------------------- $this->getMassactionBlock()->addItem('getSuggestedCategories', array('label' => Mage::helper('M2ePro')->__('Get Suggested Primary Categories'), 'url' => '')); $this->getMassactionBlock()->addItem('editPrimaryCategories', array('label' => Mage::helper('M2ePro')->__('Edit Primary Categories'), 'url' => '')); if ($this->listing->getAccount()->getChildObject()->getEbayStoreCategories()) { $this->getMassactionBlock()->addItem('editStorePrimaryCategories', array('label' => Mage::helper('M2ePro')->__('Edit Store Primary Categories'), 'url' => '')); } $this->getMassactionBlock()->addItem('editCategories', array('label' => Mage::helper('M2ePro')->__('Edit Categories'), 'url' => '')); $this->getMassactionBlock()->addItem('resetCategories', array('label' => Mage::helper('M2ePro')->__('Reset Categories'), 'url' => '')); $this->getMassactionBlock()->addItem('removeItem', array('label' => Mage::helper('M2ePro')->__('Remove Item(s)'), 'url' => '')); //-------------------------------- return parent::_prepareMassaction(); }
protected function getColumnActionsItems() { $actions = array('getSuggestedCategories' => array('caption' => Mage::helper('catalog')->__('Get Suggested Primary Category'), 'group' => 'other', 'field' => 'id', 'onclick_action' => 'EbayListingCategoryProductGridHandlerObj.' . 'actions[\'getSuggestedCategoriesAction\']'), 'editCategories' => array('caption' => Mage::helper('catalog')->__('All Categories'), 'group' => 'edit_actions', 'field' => 'id', 'onclick_action' => 'EbayListingCategoryProductGridHandlerObj.' . 'actions[\'editCategoriesAction\']'), 'editPrimaryCategories' => array('caption' => Mage::helper('catalog')->__('Primary Category'), 'group' => 'edit_actions', 'field' => 'id', 'onclick_action' => 'EbayListingCategoryProductGridHandlerObj.' . 'actions[\'editPrimaryCategoriesAction\']')); if ($this->listing->getAccount()->getChildObject()->getEbayStoreCategories()) { $actions['editStorePrimaryCategories'] = array('caption' => Mage::helper('catalog')->__('Store Primary Category'), 'group' => 'edit_actions', 'field' => 'id', 'onclick_action' => 'EbayListingCategoryProductGridHandlerObj.' . 'actions[\'editStorePrimaryCategoriesAction\']'); } $actions = array_merge($actions, array('resetCategories' => array('caption' => Mage::helper('catalog')->__('Reset Categories'), 'group' => 'other', 'field' => 'id', 'onclick_action' => 'EbayListingCategoryProductGridHandlerObj.' . 'actions[\'resetCategoriesAction\']'), 'removeItem' => array('caption' => Mage::helper('catalog')->__('Remove Item'), 'group' => 'other', 'field' => 'id', 'onclick_action' => 'EbayListingCategoryProductGridHandlerObj.' . 'actions[\'removeItemAction\']'))); return $actions; }