While doing checkout I am seeing this issue?
I dint added any plugin for shipping. In log i am getting issue like StorePickupId
does not have accessory method getStorePickupId
in class Magento Checkout.
Please let me know the exact issue.
While doing checkout I am seeing this issue?
I dint added any plugin for shipping. In log i am getting issue like StorePickupId
does not have accessory method getStorePickupId
in class Magento Checkout.
Please let me know the exact issue.
This error happening because in the estimate-shipping-methods
request exists field store_pickup_id
inside the address, and corresponding interface Magento\Quote\Api\Data\AddressInterface
has no accessory method for it. As a checkout works through Magento API all values which you pass must have getter and setter methods in the interface.
Here is example of that request with body:
{
"address": {
"street": ["Mendeleeva str.", "30 112"],
"city": "Minsk",
"region_id": "517",
"region": "Гродзенская вобласць",
"country_id": "BY",
"postcode": "123456",
"firstname": "Siarhey",
"lastname": "Uchukhlebau",
"company": "",
"telephone": "12345678"
}
}
as you can see there no field store_pickup_id
, but if you add it somehow, you get error in result (example from postman where is additional field store_pickup_id
added manually in request body):
I'll recommend you to check:
solved it by setting the currency rate !! i dont know what is the relation between both of them but it worked fine Stores -> Currency -> Currency Rates.
For me it was a customisation I introduced. However, wasn't clear what was wrong. I just saw the error 'The shipping information was unable to be saved: verify the input data and try again'
In debug.log
[2022-07-05 10:32:47] main.CRITICAL: Notice: Array to string conversion in /vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3170 {"exception":"[object] (Exception(code: 0): Notice: Array to string conversion in /vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3170 at /vendor/magento/framework/App/ErrorHandler.php:61)"} []
In this file vendor/magento/framework/DB/Adapter/Pdo/Mysql.php
I dropped some primitive logging
[...]
case 'longtext':
error_log(__METHOD__ . "\n", 3, "/var/log/mysql.log");
if (is_array($value)) {
error_log(print_r($value, true). "\n", 3, "/var/log/mysql.log");
}
$value = (string)$value;
[...]
That helped me catch object trying to be saved as string.
I used Magento \Magento\Framework\Serialize\SerializerInterface to serialize the object into string that I was using elsewhere.