Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jhillpolywood opened this issue Jul 2, 2024 · 1 comment

Comments

@jhillpolywood
Copy link

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

  • In the Magento admin, create a minimal simple product with a price of 0, and save the product
  • Reindex and clear cache
  • As a site visitor or as a Magento administrator, add the simple product as a quote item then attempt to checkout from the storefront or the Magento admin, respectively.
  • In developer mode, the following error is raised:
    Warning: Undefined array key $array in /vendor/klaviyo/magento2-extension/KlaviyoV3Sdk/KlaviyoV3Api.php on line 392
  • In production mode, the order cannot be placed and the error above is logged in var/report

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],

@kamidzi-klaviyo-integrations
Copy link
Contributor

@jhillpolywood - We were unable to reproduce the issue using the steps listed above. However, we will nonetheless place this issue in our backlog of issues to be fixed. If you feel that you would like to see the changes incorporated quicker than we can service, please feel free to submit a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants