Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

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

Closed
martin-cod opened this issue Sep 27, 2018 · 14 comments
Closed
Assignees

Comments

@martin-cod
Copy link

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
Copy link

rsisco commented Oct 16, 2018

@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
Copy link

rsisco commented Dec 12, 2018

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 rsisco mentioned this issue Dec 13, 2018
@rsisco
Copy link

rsisco commented Dec 19, 2018

This issue has been addressed in release 1.5.0.

@rsisco rsisco closed this as completed Dec 19, 2018
@martin-cod
Copy link
Author

martin-cod commented Dec 22, 2018

@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
Copy link

rsisco commented Dec 22, 2018

@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.

@rsisco rsisco reopened this Dec 22, 2018
@martin-cod
Copy link
Author

@rsisco Please follow the Magento official change to be able to identify what is missed in your mixin's saveShippingInformation method magento/magento2@9fc22ff#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
Copy link

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
Copy link
Contributor

@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
Copy link

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

@rliukshyn
Copy link

@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
Copy link
Contributor

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

@rliukshyn
Copy link

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

@prestonchoate
Copy link
Contributor

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

@prestonchoate
Copy link
Contributor

Released in version 1.5.1. Please update the extension.

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

No branches or pull requests

6 participants