It is possible to trigger the sync on a local environment but you need to be careful otherwise your local data can affect the data on Ebay. (for ex. product listing)
In order to reduce problems it is a good idea to have a local DB as much as possible updated with the LIVE site one and to exclude unwanted sync from the cron job.
There are multiple steps here involved:
- Disable unwanted sync action ( for example here I'm focused only on Ebay Orders)
- Create a test file that start the process.
- [UPDATE] Create a licence for your local
-- Introduction --
All the sync process ( in particular the order one ) is done by the cron job contained in Ess_M2ePro_Model_Cron::processSynchronization()
... so we can jump to this one Ess_M2ePro_Model_Synchronization_Cron::process()
-- STEP 1 -- -> Ess_M2ePro_Model_Synchronization_Cron::process()
I need only to check the order import process so to reduce possible issues I'm removing some task from the $synchDispatcher
.
$synchDispatcher->setTasks(array(
// Ess_M2ePro_Model_Synchronization_Tasks::DEFAULTS,
// Ess_M2ePro_Model_Synchronization_Tasks::TEMPLATES,
Ess_M2ePro_Model_Synchronization_Tasks::ORDERS,
// Ess_M2ePro_Model_Synchronization_Tasks::FEEDBACKS,
// Ess_M2ePro_Model_Synchronization_Tasks::OTHER_LISTINGS
));
-- STEP 2 --
Create a test.php
file in your root directory that call the above class::method
<?php
require_once './app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(1);
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
Mage::setIsDeveloperMode(true);
?>
Method 1 -> step 1 required
<?php
$tempSynch = new Ess_M2ePro_Model_Synchronization_Cron();
$tempSynch->process();
?>
Method 2 -> step 1 not required
Here we trigger only the receive order for Ebay
$lockItem = Mage::getModel('M2ePro/Synchronization_LockItem');
Mage::helper('M2ePro/Data_Global')->setValue('synchLockItem',$lockItem);
$logs = Mage::getModel('M2ePro/Synchronization_Log');
Mage::helper('M2ePro/Data_Global')->setValue('synchLogs',$logs);
$profiler = Mage::getModel('M2ePro/Synchronization_Profiler',$profilerParams);
Mage::helper('M2ePro/Data_Global')->setValue('synchProfiler',$profiler);
$tempSynch = new Ess_M2ePro_Model_Ebay_Synchronization_Tasks_Orders_Receive();
$tempSynch->process();
-- STEP 3 -- -->
Create new license for your local test magento installation
At this point you are ready to go and start:
Just put you breakpoints and run the test.php page.