1
0
mirror of synced 2024-11-29 08:26:09 +03:00

history init

This commit is contained in:
Alex Lushpai 2015-06-22 18:18:23 +03:00
parent adcdd015b9
commit c4553a0f58
3 changed files with 23 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class Retailcrm_Retailcrm_Model_Exchange
* *
* @return bool * @return bool
*/ */
public function orderCreate($order) public function ordersCreate($order)
{ {
$this->_config = Mage::getStoreConfig('retailcrm', $order->getStoreId()); $this->_config = Mage::getStoreConfig('retailcrm', $order->getStoreId());
@ -122,6 +122,18 @@ class Retailcrm_Retailcrm_Model_Exchange
} }
} }
public function ordersHistory()
{
$this->_config = Mage::getStoreConfig('retailcrm');
$statuses = array_flip(array_filter($this->_config['status']));
$paymentsStatuses = array_flip(array_filter($this->_config['paymentstatus']));
$payments = array_filter($this->_config['payment']);
$shippings = array_filter($this->_config['shipping']);
Mage::log(var_export($this->_config, TRUE), null, 'history.log');
}
/** /**
* @param $customer * @param $customer
* @return mixed * @return mixed

View File

@ -15,7 +15,7 @@ class Retailcrm_Retailcrm_Model_Observer
public function orderCreate(Varien_Event_Observer $observer) public function orderCreate(Varien_Event_Observer $observer)
{ {
$order = $observer->getEvent()->getOrder(); $order = $observer->getEvent()->getOrder();
Mage::getModel('retailcrm/exchange')->orderCreate($order); Mage::getModel('retailcrm/exchange')->ordersCreate($order);
return true; return true;
} }
@ -28,4 +28,9 @@ class Retailcrm_Retailcrm_Model_Observer
} }
} }
} }
public function importHistory()
{
Mage::getModel('retailcrm/exchange')->ordersHistory();
}
} }

View File

@ -62,6 +62,10 @@ SOFTWARE.
<schedule><cron_expr>* */4 * * *</cron_expr></schedule> <schedule><cron_expr>* */4 * * *</cron_expr></schedule>
<run><model>retailcrm/observer::exportCatalog</model></run> <run><model>retailcrm/observer::exportCatalog</model></run>
</icml> </icml>
<history>
<schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
<run><model>retailcrm/observer::importHistory</model></run>
</history>
</jobs> </jobs>
</crontab> </crontab>
<adminhtml> <adminhtml>