retailcrm / prestashop-module

PrestaShop integration plugin
https://simla.com
MIT License
7 stars 30 forks source link

Неверный формат Email при выгрузке заказа #157

Closed TemKaSD closed 2 years ago

TemKaSD commented 2 years ago

Здравствуйте. Уже несколько раз сталкивались с данной ошибкой, не выгружает заказы, хотя с мылом всё в порядке вроде. Email клиента: 020206evgenia@gmail.com image

opheugene commented 2 years ago

Здравствуйте! Протестировал указанный email, клиент и заказ успешно выгрузились. Есть возможность предоставить логи запросов?

TemKaSD commented 2 years ago

[2021-11-16T05:33:10+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Warning: something disrupted correct process execution. All information will be provided here. [2021-11-16T05:33:10+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Array ( [type] => 1 [message] => Uncaught TypeError: Argument 1 passed to PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision::getPrecision() must be of the type int, null given, called in /classes/Context.php on line 489 and defined in /src/Core/Localization/CLDR/ComputingPrecision.php:41 Stack trace:

0 /classes/Context.php(489): PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision->getPrecision()

1 /classes/Cart.php(2171): ContextCore->getComputingPrecision()

2 /modules/retailcrm/lib/RetailcrmCartUploader.php(220): CartCore->getOrderTotal()

3 /modules/retailcrm/lib/RetailcrmCartUploader.php(132): RetailcrmCartUploader::isCartEmpty()

4 /modules/retailcrm/lib/events/RetailcrmAbandonedCartsEv

[file] => /src/Core/Localization/CLDR/ComputingPrecision.php
[line] => 41

)

[2021-11-16T05:33:12+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Warning: something disrupted correct process execution. All information will be provided here. [2021-11-16T05:33:12+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Array ( [type] => 1 [message] => Uncaught TypeError: Argument 1 passed to PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision::getPrecision() must be of the type int, null given, called in /classes/Context.php on line 489 and defined in /src/Core/Localization/CLDR/ComputingPrecision.php:41 Stack trace:

0 /classes/Context.php(489): PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision->getPrecision()

1 /classes/Cart.php(2171): ContextCore->getComputingPrecision()

2 /modules/retailcrm/lib/RetailcrmCartUploader.php(220): CartCore->getOrderTotal()

3 /modules/retailcrm/lib/RetailcrmCartUploader.php(132): RetailcrmCartUploader::isCartEmpty()

4 /modules/retailcrm/lib/events/RetailcrmAbandonedCartsEv

[file] => /src/Core/Localization/CLDR/ComputingPrecision.php
[line] => 41

)

[2021-11-16T05:33:13+03:00] @ [ordersGet] Not found [2021-11-16T05:33:14+03:00] @ [customersEdit] Customer is not loaded [2021-11-16T05:33:14+03:00] phones[2].number => This value should not be blank.\n [2021-11-16T05:33:14+03:00] @ [ordersCreate] Order is not loaded [2021-11-16T05:33:14+03:00] email => Invalid e-mail format\n [2021-11-16T05:33:20+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Warning: something disrupted correct process execution. All information will be provided here. [2021-11-16T05:33:20+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Array ( [type] => 1 [message] => Uncaught TypeError: Argument 1 passed to PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision::getPrecision() must be of the type int, null given, called in /classes/Context.php on line 489 and defined in /src/Core/Localization/CLDR/ComputingPrecision.php:41 Stack trace:

0 /classes/Context.php(489): PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision->getPrecision()

1 /classes/Cart.php(2171): ContextCore->getComputingPrecision()

2 /modules/retailcrm/lib/RetailcrmCartUploader.php(220): CartCore->getOrderTotal()

3 /modules/retailcrm/lib/RetailcrmCartUploader.php(132): RetailcrmCartUploader::isCartEmpty()

4 /modules/retailcrm/lib/events/RetailcrmAbandonedCartsEv

[file] => /src/Core/Localization/CLDR/ComputingPrecision.php
[line] => 41

)

[2021-11-16T05:33:21+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Warning: something disrupted correct process execution. All information will be provided here. [2021-11-16T05:33:21+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Array ( [type] => 1 [message] => Uncaught TypeError: Argument 1 passed to PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision::getPrecision() must be of the type int, null given, called in /classes/Context.php on line 489 and defined in /src/Core/Localization/CLDR/ComputingPrecision.php:41 Stack trace:

0 /classes/Context.php(489): PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision->getPrecision()

1 /classes/Cart.php(2171): ContextCore->getComputingPrecision()

2 /modules/retailcrm/lib/RetailcrmCartUploader.php(220): CartCore->getOrderTotal()

3 /modules/retailcrm/lib/RetailcrmCartUploader.php(132): RetailcrmCartUploader::isCartEmpty()

4 /modules/retailcrm/lib/events/RetailcrmAbandonedCartsEv

[file] => /src/Core/Localization/CLDR/ComputingPrecision.php
[line] => 41

)

[2021-11-16T05:33:21+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Warning: something disrupted correct process execution. All information will be provided here. [2021-11-16T05:33:21+03:00] @ [RetailcrmJobManager::defaultShutdownHandler] Array ( [type] => 1 [message] => Uncaught TypeError: Argument 1 passed to PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision::getPrecision() must be of the type int, null given, called in /classes/Context.php on line 489 and defined in /src/Core/Localization/CLDR/ComputingPrecision.php:41 Stack trace:

0 /classes/Context.php(489): PrestaShop\PrestaShop\Core\Localization\CLDR\ComputingPrecision->getPrecision()

1 /classes/Cart.php(2171): ContextCore->getComputingPrecision()

2 /modules/retailcrm/lib/RetailcrmCartUploader.php(220): CartCore->getOrderTotal()

3 /modules/retailcrm/lib/RetailcrmCartUploader.php(132): RetailcrmCartUploader::isCartEmpty()

4 /modules/retailcrm/lib/events/RetailcrmAbandonedCartsEv

[file] => /src/Core/Localization/CLDR/ComputingPrecision.php
[line] => 41

)

opheugene commented 2 years ago

У вас включена выгрузка брошенных корзин? Много ошибок при проверке пустых корзин. Предлагаю включить debug-режим в настройках модуля и повторить запрос с указанным email, сейчас не видны сами данные запроса

TemKaSD commented 2 years ago

Брошенные корзины включены, да. Про дебаг режим в модуле не понял, не вижу такой настройки.

max-baranikov commented 2 years ago

Здравствуйте,

Debug-режим можно включить на странице с дополнительными настройками выполнив тройной клик по заголовку Simla.com, далее поставить галочку напротив поля Режим отладки, нажать кнопку Сохранить и обновить страницу

После чего можете повторно произвести выгрузку заказа, и прислать логи по данному заказу

Обращаю внимание, что в логах может храниться конфиденциальная информация, такая как api-ключ системы, его следует убрать из присылаемых логов в целях вашей безопасности

Фрагмент логов будет выглядеть примерно так:

[2021-11-29T16:30:35+03:00] (DEBUG) <POST `https://demo.retailcrm.ru/api/v5/orders/create`, status: 201>  POST fields: `Array
(
    [apiKey] => yourApiKey
    [order] => {"externalId":2,"createdAt":"2021-11-29 11:46:28","firstName":"test email","lastName":"test email","email":"020206evgenia@gmail.com","delivery":{"address":{"index":"123456","city":"asdf","text":"asdfasdf"},"cost":0,"netCost":0},"countryIso":"RU","discountManualAmount":0,"customerComment":"Manual order -- Employee: A. Lushpai","items":[{"externalIds":[{"code":"prestashop","value":"4_2"}],"offer":{"externalId":"4"},"productName":"MacBook","quantity":"1","initialPrice":1357,"purchasePrice":750}],"customer":{"id":136},"contragent":{"contragentType":"individual"}}
)
`
[2021-11-29T16:30:35+03:00] (DEBUG) <ordersCreate> {"success":true,"id":466,"order":{"slug":466,"bonusesCreditTotal":0,"bonusesChargeTotal":0,"id":466,"number":"466A","externalId":"2","orderType":"eshop-individual","orderMethod":"shopping-cart","privilegeType":"none","countryIso":"RU","createdAt":"2021-11-29 11:46:28","statusUpdatedAt":"2021-11-29 16:30:35","summ":1357,"totalSumm":1357,"prepaySum":0,"purchaseSumm":750,"markDatetime":"2021-11-29 16:30:35","lastName":"test email","firstName":"test email","email":"020206evgenia@gmail.com","call":false,"expired":false,"customerComment":"Manual order -- Employee: A. Lushpai","customer":{"type":"customer","id":136,"externalId":"12","isContact":false,"createdAt":"2021-04-22 13:58:34","vip":false,"bad":false,"site":"baranikov-retailcrm-ru","contragent":{"contragentType":"individual"},"tags":[],"marginSumm":1494.5,"totalSumm":1494.5,"averageSumm":747.25,"ordersCount":2,"costSumm":0,"customFields":[],"personalDiscount":0,"address":{"id":91,"index":"123456","countryIso":"RU","city":"asdf","text":"asdfasdf"},"segments":[],"firstName":"User","lastName":"test","email":"020206evgenia@gmail.com","emailMarketingUnsubscribedAt":"2021-04-22 15:49:30","phones":[{"number":"0102030405"}]},"contact":{"type":"customer","id":136,"externalId":"12","isContact":false,"createdAt":"2021-04-22 13:58:34","vip":false,"bad":false,"site":"baranikov-retailcrm-ru","contragent":{"contragentType":"individual"},"tags":[],"marginSumm":1494.5,"totalSumm":1494.5,"averageSumm":747.25,"ordersCount":2,"costSumm":0,"customFields":[],"personalDiscount":0,"address":{"id":91,"index":"123456","countryIso":"RU","city":"asdf","text":"asdfasdf"},"segments":[],"firstName":"User","lastName":"test","email":"020206evgenia@gmail.com","emailMarketingUnsubscribedAt":"2021-04-22 15:49:30","phones":[{"number":"0102030405"}]},"contragent":{"contragentType":"individual"},"delivery":{"cost":0,"netCost":0,"address":{"index":"123456","countryIso":"RU","city":"asdf","text":"asdfasdf"}},"site":"baranikov-retailcrm-ru","status":"new","items":[{"bonusesChargeTotal":0,"bonusesCreditTotal":0,"markingCodes":[],"discounts":[],"id":669,"externalIds":[{"code":"prestashop","value":"4_2"}],"initialPrice":1357,"discountTotal":0,"prices":[{"price":1357,"quantity":1}],"vatRate":"10.00","createdAt":"2021-11-29 11:46:28","quantity":1,"status":"new","offer":{"displayName":"MacBook","id":3782,"externalId":"4","name":"MacBook","article":"RP-demo_4","vatRate":"10.00","properties":[],"unit":{"code":"pc","name":"Штука","sym":"шт."}},"properties":[],"purchasePrice":750}],"payments":[],"fromApi":true,"shipped":false,"customFields":{"increment_stock":false}}}