1
0
mirror of synced 2024-11-25 14:36:08 +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()) { if ($response->isSuccessful()) {
$this->_isCredentialCorrect = true; $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); $history = $client->ordersHistory($lastRun);
Mage::getModel('core/config')->saveConfig('retailcrm/general/history', $timeMark); 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> <run><model>retailcrm/observer::exportCatalog</model></run>
</icml> </icml>
<history> <history>
<schedule><cron_expr>*/5 * * * *</cron_expr></schedule> <schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
<run><model>retailcrm/observer::importHistory</model></run> <run><model>retailcrm/observer::importHistory</model></run>
</history> </history>
</jobs> </jobs>

View File

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