antonio

Use action in php code

Recommended Posts

Hello I need to stop some item that has a specific requirement in a php script or observer.

I have magento 1.9.1.0, php 5.5.9 .

When I try this code in a php script:

require_once(realpath(__DIR__) . '/bootstrap.php');


$dispatcherObject = Mage::getModel('M2ePro/Connector_Ebay_Item_Dispatcher');
$action = 4; 
$listingsProductsIds = array( 23226 );
$params['status_changer'] = 0; 

$result = (int)$dispatcherObject->process($action, $listingsProductsIds, $params);
$actionId = (int)$dispatcherObject->getLogsActionId();

I get an exception:

Fatal error: Uncaught Ess_M2ePro_Model_Exception_Logic: Instance does not exist. in /var/www/html/httpdocs/app/code/community/Ess/M2ePro/Model/Abstract.php:27 Stack trace: #0 /var/www/html/httpdocs/app/code/community/Ess/M2ePro/Helper/Component.php(517): Ess_M2ePro_Model_Abstract->loadInstance(23226, NULL) #1 /var/www/html/httpdocs/app/code/community/Ess/M2ePro/Helper/Component/Ebay.php(88): Ess_M2ePro_Helper_Component->getComponentObject('ebay', 'Listing_Product', 23226, NULL) #2 /var/www/html/httpdocs/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Dispatcher.php(243): Ess_M2ePro_Helper_Component_Ebay->getObject('Listing_Product', 23226) #3 /var/www/html/httpdocs/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Dispatcher.php(30): Ess_M2ePro_Model_Connector_Ebay_Item_Dispatcher->prepareProducts(Array) #4 /var/www/html/httpdocs/scripts/m2epro_script.php(10): Ess_M2ePro_Model_Connector_Ebay_Item_Dispatcher->process(4, Array, Array) #5 {main} thrown in /var/www/html/httpdocs/app/code/community/Ess/M2ePro/Model/Abstract.php on line 27

How to create an instance ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.