klaviyo / magento2-klaviyo

37 stars 51 forks source link

Logged error prevents order placement when quote/order item total is 0. #307

Open jhillpolywood opened 5 days ago

jhillpolywood commented 5 days ago

Environment details

PHP version: 8.1 Magento version: 2.4.5-p8 Klaviyo extension version: 4.1.4 Anything else that would help a developer reproduce the bug?

Steps to reproduce

Expected result

Order is placed successfully.

Actual result

The following error is raised: Warning: Undefined array key $array in /vendor/klaviyo/magento2-extension/KlaviyoV3Sdk/KlaviyoV3Api.php on line 392

Additional information

We patched this in the interim by setting a fallback value of (int)0 for the missing array key reported in the error:

self::VALUE_KEY_PAYLOAD => empty($eventProperties[self::VALUE_KEY_PAYLOAD_OLD]) ? 0 : $eventProperties[self::VALUE_KEY_PAYLOAD_OLD],