klaviyo / magento2-klaviyo

37 stars 51 forks source link

Fix shipping information update on checkout for klEmailConsent and klSmsConsent fields #244

Closed dadolun95 closed 1 year ago

dadolun95 commented 1 year ago

Description

PR preventing Klaviyo to block checkout from working - error with method getKlSmsConsent() and getklEmailConsent() already issued on #191

Environment

Magento 2.4.5 PHP 8.1

Manual Testing Steps

Enable the module, then go at "Stores > Configuration > Klaviyo > Consent at Checkout" section and flag "Subscribe contacts to email marketing at checkout" to "Yes" or/and flag "Subscribe contacts to SMS marketing at checkout" to "Yes". Save the configurations, clean config cache. After that go on checkout as guest and try complete an order.

Expected Results

Before this fix, magento checkout will block you sending a 500 error on rest/default/V1/guest-carts/shipping-information endpoint and showing the following message (if your magento is in developer mode, webapi report error on production instead): << Property "KlEmailConsent" does not have accessor method "getKlEmailConsent" in class "Magento\Quote\Api\Data\AddressExtensionInterface". >> or << Property "KlSmsConsent" does not have accessor method "getKlSmsConsent" in class "Magento\Quote\Api\Data\AddressExtensionInterface". >> depending on "Consent at Checkout" configuration. After the fix with same procedure you'll be able to complete the order normally.

dadolun95 commented 1 year ago

Hi @cykolln CHANGELOG file updated as you requested. Hope to see my fix on the official repository next week :+1: Wish you a very nice weekend!