1
0
mirror of synced 2024-11-25 06:26:04 +03:00
tiu-client/README.md

76 lines
2.3 KiB
Markdown
Raw Normal View History

2015-09-07 18:53:53 +03:00
# tiu-client
2015-09-09 15:54:20 +03:00
2016-02-27 18:07:46 +03:00
Application for export orders from [tiu.ru](http://tiu.ru) to [retailCRM](http://retailcrm.ru)
2015-09-09 15:54:20 +03:00
2016-02-27 18:07:46 +03:00
Can be used with [prom.ua](http://prom.ua), [deal.by](http://deal.by), [satu.kz](http://satu.kz)
2015-09-09 15:54:20 +03:00
2016-02-27 18:07:46 +03:00
##Setup
2015-09-09 15:54:20 +03:00
2016-02-27 18:07:46 +03:00
Execute in your shell
2015-09-07 18:53:53 +03:00
2015-09-09 15:54:20 +03:00
```sh
2015-09-09 15:56:53 +03:00
git clone https://github.com/retailcrm/tiu-client.git
2015-09-07 18:53:53 +03:00
cd tiu-client
curl -sS https://getcomposer.org/installer | php
php composer.phar require retailcrm/api-client-php ~3.0.0
```
2016-02-27 18:07:46 +03:00
Create & fill configuration file at config/config.php (see /config/config-dist.php)
2015-09-07 18:53:53 +03:00
2016-02-27 18:07:46 +03:00
##Usage
Create a Cron job
2015-09-07 18:53:53 +03:00
2015-09-09 15:54:20 +03:00
```sh
2016-02-27 18:07:46 +03:00
*/10 * * * * /usr/bin/php /path/to/tiu-client/run.php
```
##Data structure
tiu.ru exports orders data as xml file available via special link like this
```
https://my.tiu.ru/cabinet/export_orders/xml/2372403?hash_tag=47158ffb1af38cb31f1c521dc8a1e1208
2015-09-07 18:53:53 +03:00
```
2015-09-09 15:54:20 +03:00
2016-02-27 18:07:46 +03:00
This link [can be taken from backoffice](https://my.tiu.ru/cabinet/order/export_orders)
####XML example
2015-09-09 15:54:20 +03:00
```xml
<orders date="2015-08-31 17:32">
<order id="2803303" state="new">
<name>Иван Петров</name>
<phone>+79111111111</phone>
2016-02-27 18:07:46 +03:00
<email>test@example.org</email>
2015-09-09 15:54:20 +03:00
<date>22.07.15 19:24</date>
2016-02-27 18:07:46 +03:00
<address>Новокузнецк, ул. Тестовая 71</address>
2015-09-09 15:54:20 +03:00
<paymentType>Наличными</paymentType>
<deliveryType>Доставка курьером</deliveryType>
<priceRUB>691.00</priceRUB>
<items>
<item id="68534240">
<external_id>717432</external_id>
<name>Hama H-74229 hdmi 1.3 a-c (mini)</name>
<quantity>1.00</quantity>
<currency>RUB</currency>
2016-02-27 18:07:46 +03:00
<image>http://images.ru.prom.st/hama-h-74229.jpg</image>
<url>http://example-shop.tiu.ru/hama-h-74229</url>
2015-09-09 15:54:20 +03:00
<price>366.00</price>
<sku/>
</item>
<item id="68534241">
<external_id>717436</external_id>
<name>Hama H-74237 hdmi 1.3 a-c (mini)</name>
<quantity>1.00</quantity>
<currency>RUB</currency>
2016-02-27 18:07:46 +03:00
<image>http://images.ru.prom.st/hama-h-74237.jpg</image>
<url>http://example-shop.tiu.ru/hama-h-74237</url>
2015-09-09 15:54:20 +03:00
<price>325.00</price>
<sku/>
</item>
</items>
</order>
</orders>
2015-09-07 18:53:53 +03:00
```