laravel Adding shipping rate to checkout session results in “invalid array” exception

The solution for “laravel Adding shipping rate to checkout session results in “invalid array” exception” can be found here. The following code will assist you in solving the problem.

//Right now your code is just passing a single hash for shipping_options instead of an array, so instead of this:

‘shipping_options’ => [
‘shipping_rate’ => [env(‘SHIPPING_KEY’)],
],
//you need to move the brackets to look like this:

‘shipping_options’ => [
[‘shipping_rate’ => env(‘SHIPPING_KEY’),],
],

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in