classyllama / ClassyLlama_AvaTax

This extension has been deprecated in favor of https://github.com/avadev/Avalara-AvaTax-for-Magento2
Open Software License 3.0
23 stars 15 forks source link

payloadExtender is not supported in default shipping-save-processor #181

Closed martin-cod closed 5 years ago

martin-cod commented 6 years ago

The following file vendor/classyllama/module-avatax/view/frontend/web/js/model/shipping-save-processor/default.js overwrites the core file vendor/magento/module-checkout/view/frontend/web/js/model/shipping-save-processor/default.js Since Magento 2.2 default shipping-save-processor supports payloadExtender to allow third party extensions to modify the payload for the shipping address selection process

Preconditions

  1. Magento 2.2.5
  2. avalara/avatax 15.5.2
  3. PHP 7.1.20

Steps to reproduce

  1. Add product to cart and got to checkout
  2. locate the static js file file in the browser dev tools static/../../Magento_Checkout/js/model/shipping-save-processor/payload-extender.js

Expected result

  1. The file should be loaded
  2. Overwritten shipping-save-processor/default.js file should support payloadExtender

Actual result

  1. File is not loaded
rsisco commented 6 years ago

@martin-cod - Thank you for reporting this issue. We are working on a solution that will retain backward-compatibility with Magento 2.1.x, since it is still officially supported by the extension.

rsisco commented 5 years ago

Update: These changes have been merged and will be included in the next release of the extension.

@sjb9774 - These changes need to be merged into the 2.x branch as well.

rsisco commented 5 years ago

This issue has been addressed in release 1.5.0.

martin-cod commented 5 years ago

@rsisco I have just reviewed the code in release 1.5.0. and found that the file vendor/classyllama/module-avatax/view/frontend/web/js/model/shipping-save-processor/default.js became a mixin but payloadExtender is still not supported. Could you please check it once again? The image below is taken from the original Magento code payloadextender

rsisco commented 5 years ago

@martin-cod - Can you provide a use case you are trying to support so that we may properly refactor and test the code if applicable? The original issue stated that the problem was that we were overriding the core default.js file and losing the payload extender, which is now not the case.

martin-cod commented 5 years ago

@rsisco Please follow the Magento official change to be able to identify what is missed in your mixin's saveShippingInformation method https://github.com/magento/magento2/commit/9fc22ff2fe2e0c62d75d00d8ce1d55207ea6462b#diff-6f15bee8297c1e4e27c4d32164904b80

I used payloadExtender object in my custom code to extend shippingInformation save processor. Having AvaTax module installed I lost that possibility. Hope it helps.

joshuaadickerson commented 5 years ago

The only thing to do to get that supported in 2.2 is to add that payloadExtender line as @martin-cod said. Without it, it breaks a lot of functionality for us.

prestonchoate commented 5 years ago

@martin-cod I just merged some code into develop that @sjb9774 worked on to address this. Could you pull that down and see if it resolves the issue. If so I will prep it for a new official release. Thanks!

rliukshyn commented 5 years ago

@rsisco here is the use case - I want to use payload-extender to pass extension attributes data to the server.

rliukshyn commented 5 years ago

@prestonchoate I've checked out develop branch and it looks like it is working. I am able to use payload-extender on checkout. Verified on 2.2.5 Commerce edition

prestonchoate commented 5 years ago

@kriby Perfect. I'll add this to the list of changes for the next version release.

rliukshyn commented 5 years ago

@prestonchoate what is the target date for the next release?

prestonchoate commented 5 years ago

@kriby Not entirely sure yet. Probably next week some time.

prestonchoate commented 5 years ago

Released in version 1.5.1. Please update the extension.