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

Orders with 0.00 Total Not Syncing to Dotdigital #319

Open
julianchristmas opened this issue Feb 19, 2025 · 2 comments
Open

Orders with 0.00 Total Not Syncing to Dotdigital #319

julianchristmas opened this issue Feb 19, 2025 · 2 comments

Comments

@julianchristmas
Copy link

Issue Summary

Orders containing only products priced at 0.00 are not syncing to Dotdigital due to a filtering issue in the Magento-Dotdigital connector. This issue affects over 26,000 orders in our system and disrupts order reporting and automation workflows.


Steps to Reproduce

  1. Create an order in Magento containing only products with a price of 0.00.
  2. Observe the payload sent to Dotdigital.
  3. The order_total field is missing from the payload.
  4. The order is not properly synced to Dotdigital.

Root Cause Analysis

  • The issue originates from the array_filter() function used in Dotdigitalgroup/Email/Model/Connector/Order.php, specifically in the expose() method.
  • PHP’s array_filter() function removes values considered "empty", which includes 0.00, leading to unintended data loss.
  • This results in valid zero-total orders not being recognized or processed by Dotdigital.

Current Implementation:

return array_filter($properties);

Impact

  • Orders with 0.00 total are valid business cases and should be properly synced.
  • Lack of proper syncing distorts order data in Dotdigital, impacting reporting and automation.
  • Affects compliance, analytics, and customer engagement workflows.

Proposed Fix
Modify the array_filter() call to only remove null values, ensuring 0.00 remains in the payload:

return array_filter($properties, function ($value) {
    return !is_null($value);
});

Version information

Magento Version: 1.9
Dotdigital Extension Version: 6.2.29

@sta1r
Copy link
Contributor

sta1r commented Feb 19, 2025

@julianchristmas Hey - do you fancy creating a PR? Just fork this repo, and PR from your fork into the dotmailer:develop branch. If you can confirm what PHP version you are running that would be handy.

@sta1r
Copy link
Contributor

sta1r commented Feb 28, 2025

Hi again, please could you check out this PR: #320

It should resolve your issue, extended slightly to catch empty arrays as well (I've explained why in the description).

If you could confirm, we'll merge the PR.

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

No branches or pull requests

2 participants