1
0
mirror of synced 2024-11-21 20:46:06 +03:00
This commit is contained in:
Alex Lushpai 2015-06-29 17:28:39 +03:00
parent 57bf7f4c18
commit 702a8b0c64
4 changed files with 6 additions and 27 deletions

View File

@ -31,23 +31,6 @@ class Retailcrm_Retailcrm_Block_Adminhtml_System_Config_Form_Fieldset_Base exten
if ($response->isSuccessful()) {
$this->_isCredentialCorrect = true;
}
$lastRun = Mage::getStoreConfig('retailcrm/general/history');
if (!empty($lastRun)) {
$lastRun = new DateTime(
date(
'Y-m-d H:i:s',
strtotime('-1 days', strtotime(date('Y-m-d H:i:s')))
)
);
} else {
$lastRun = new DateTime($lastRun);
}
$history = $client->ordersHistory($lastRun);
var_dump($history);
Mage::getModel('core/config')->saveConfig('retailcrm/general/history', $history->getGeneratedAt());
}
}
}

View File

@ -147,6 +147,7 @@ class Retailcrm_Retailcrm_Model_Exchange
$history = $client->ordersHistory($lastRun);
Mage::getModel('core/config')->saveConfig('retailcrm/general/history', $timeMark);
Mage::log($timeMark, null, 'history.log');
}
/**

View File

@ -63,7 +63,7 @@ SOFTWARE.
<run><model>retailcrm/observer::exportCatalog</model></run>
</icml>
<history>
<schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
<schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
<run><model>retailcrm/observer::importHistory</model></run>
</history>
</jobs>

View File

@ -43,7 +43,6 @@ SOFTWARE.
<general translate="label comment" module="retailcrm">
<expanded>1</expanded>
<label>General</label>
<comment>General settings that are required to connect RetailCRM and Magento.</comment>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
@ -72,8 +71,7 @@ SOFTWARE.
</general>
<shipping translate="label comment" module="retailcrm">
<expanded>0</expanded>
<label>Shipping methods</label>
<comment>Comparison of shipping methods</comment>
<label>Shipping</label>
<frontend_type>text</frontend_type>
<sort_order>11</sort_order>
<show_in_default>1</show_in_default>
@ -83,8 +81,7 @@ SOFTWARE.
</shipping>
<payment translate="label comment" module="retailcrm">
<expanded>0</expanded>
<label>Payment methods</label>
<comment>Comparison of payment methods</comment>
<label>Payment Method</label>
<frontend_type>text</frontend_type>
<sort_order>12</sort_order>
<show_in_default>1</show_in_default>
@ -94,8 +91,7 @@ SOFTWARE.
</payment>
<payment_status translate="label comment" module="retailcrm">
<expanded>0</expanded>
<label>Payment statuses</label>
<comment>Comparison of payment statuses</comment>
<label>Payment Information</label>
<frontend_type>text</frontend_type>
<sort_order>13</sort_order>
<show_in_default>1</show_in_default>
@ -105,8 +101,7 @@ SOFTWARE.
</payment_status>
<status translate="label comment" module="retailcrm">
<expanded>0</expanded>
<label>Order statuses</label>
<comment>Comparison of order statuses</comment>
<label>Order Statuses</label>
<frontend_type>text</frontend_type>
<sort_order>14</sort_order>
<show_in_default>1</show_in_default>