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

Fix getAddressData in MailchimpTags build #1228

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mmenozzi
Copy link

The \Ebizmarts_MailChimp_Model_Api_Subscribers_MailchimpTags::getAddressData method appears to be wrong and this PR aims to fix it.

Prior to this PR:

  • If the customer has a default billing and shipping address but has not any order, its BILLING and SHIPPING tags are not exported, which is wrong.
  • If the customer has at least one order its BILLING and SHIPPING relevant properties are built with the customer's default address anyway, which has no sense at all.
  • In some situations the getAddressData method returns an instance of Mage_Sales_Model_Address instead of an array. This cause an empty JSON object passed to Mailchimp API which leads to the "Data did not match any of the schemas described in anyOf" error.

After this PR, if the customer has a default billing/shipping address it will be always exported as the BILLING/SHIPPING tags regardless the presence of any order.

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

Successfully merging this pull request may close these issues.

1 participant