SendCloud / sendcloud

A Magento 2 module for Sendcloud
9 stars 21 forks source link

Pickup location address #160

Closed jdereus87 closed 1 year ago

jdereus87 commented 1 year ago

For a customer we just upgraded from 1.8.0 -> 2.0.18.

In the version 1.8.0, on the orderview page in adminhtml, we could see the pickup location address under Shipping and Handling information below the selected shipping method.

Is this a change in implementation or is this bugged?

Customer details Magento 2.4.2-p2 OneStepCheckout module PC_Postcode in checkout

jdereus87 commented 1 year ago

Never mind, customer support fixed this by adding a rule.

jbclaudio commented 1 year ago

@jdereus87 I am running into the same problem. Is there a specific rule that needs to be adjusted or something?

jdereus87 commented 1 year ago

@jbclaudio I am not sure. Its something their customer support added. But coincidentally I just called them 30ms ago because today it was not working again. They send it up to tech support.

gjportegies commented 1 year ago

One of our customers is running into this issue. How can we fix this?

jdereus87 commented 1 year ago

@jbclaudio @gjportegies

We still had some issues with this it seemed. Since sendcloud first line support is 1 week behind and the technical staff only seemed to reply with the 'standard' answers like 'update your module' etc we decided to find out and debug the problem ourselves. We updated the module to its newest version, but that did not make difference.

So to describe our problem: some orders (like 10%/30% that were placed with the servicepoint ID did not go through to sendcloud. We checked the database and found that in both the sales_order table and the quote table the necessary sencloud columns were not filled.

We tested this in the checkout (which runs the onestepcheckout_iOSC). The tricky part was finding the conditions under which the quote table did not fill. So to give you an image of this checkout: the address fields are in the top left of the page and the delivery method selection in the top right. As far as a customer is concerned, he can fill either one first.

Condition under which the problems occur (for us at least): A customer fills in part of the address (like name, address etc), but still leaves some fields open that are required (like the phone number in this instance). It then first selects the delivery point before, lets say, entering the required phone number. The delivery point on the frontend gets selected, but it wont be able to load the part of the script that sends the sendcloud pickup point data to the quote. We can actually see it not-happing, both trough the database, but also because the delivery method spinner won't activate. The customer then proceeds to fill in the rest of his address fields and select the shipping method and proceeds to place the order. In all these parts the quote won't be filled anymore with the sencloud data. The verification lets it through because all fields are filled, but the sencloud data in the quote is still empty. This quote data is to be set in the new order. So empty servicepoints in quote, empty servicepoints in order, empty servicepoints in the sencloud panel.

For now we fixed it with a composer patch. Validate.js seems to run before placeOrder. We added the function that sends the shipping information to the quote again so it wont be empty. Composer patch below https://easyupload.io/3p9kdv

Aquive commented 1 year ago

@jdereus87 added this to our repo to make it easier for others to make use of the patch: https://github.com/AquiveMedia/Sendcloud-servicepoints-patch

logeecom commented 1 year ago

Hi all, Thanks for reaching out to us. We will investigate the reported issue, review the solution and get back to you. Best regards

jdereus87 commented 1 year ago

@logeecom

Thanks for looking.

Our fix might not be the best solution I think we were a bit too quick on creating the quickfix. We argued that if it running the shippingSaveProcessor when submitting the order might just do the trick. It does in most of the cases, but it also defeats the purpose of the validateshippinginformation mixin in the module. However the request is being done async while submitting the order and forwarding to the payment service provider. So it now all depends on which request is quicker if it might work or not. So far all of them have worked, but I think a better solution might be needed.

However we did look a bit further into why it is all happening. In SendCloud_SendCloud/js/servicePoint/view/checkout/shipping/servicePoint.js:116 it runs result = validateShippingInformation which also triggers your mixin in: SendCloud_SendCloud/js/mixins/checkout/view/shipping-mixin.js. It runs this._super() triggering the original validateShippingInformation method in a try block.

Its problems occur on: Magento_Checkout/js/view/shipping.js -> validateshippinginformation:310. It receives a false on the this.source.get('params.invalid') which results in a a false also being returned. (admittely, weird statement, since if you leave the e-mailaddress empty it will work. magento quirk or bug). However, it returns false.

The try block above fails (shipping-mixin), resulting in also returning a false statement. The result variable = false and it cant run the method setShippingInformationAction, thus resulting in a quote without the sendcloud service point data.

OSC The steps above can also be reproduced on the native checkout. However since the native checkout is working with the 'steps', you can't order without having to proceed to the billing step (which I think re-triggers the save or set shipment functions and requires everything to be filled before proceeding). However this is a problem on the Onestepcheckout_iOSC and might be a problem on other OSC's.

jdereus87 commented 1 year ago

@ivan-logeecom any update on this?

logeecom commented 1 year ago

Hi @jdereus87 and all others,

Please note that the request you made requires more investigation.

The Sendcloud support team is best to investigate more in-depth.

Please forward your request via the Support page in sendcloud: https://app.sendcloud.com/v2/support or reach out to support@sendcloud.com.

In this case, we need more details and to keep everything and everyone secure and protected, please forward your request via mentioned channels so we can investigate this further.

Thank you for understanding.

Best regards

jdereus87 commented 1 year ago

@logeecom

Lol what a bunch of bs.

The Sendcloud support team is best to investigate more in-depth. No they are certainly not. They do not maintain the magento2 module and after 2 months of conversing with their ultimately slow support we were not 1 step further, simply because they do not understand.

Please forward your request via the Support page in sendcloud: https://app.sendcloud.com/v2/support or reach out to support@sendcloud.com. Already did. Terrible customer support when it comes to technical problems.

In this case, we need more details and to keep everything and everyone secure and protected, please forward your request via mentioned channels so we can investigate this further. How do you need more details? I have given you all the necessary details to exact files & lines and a process description. Keeping something secure & protected is a bs argument. At least be honest that you cant be arsed to do this without sendcloud giving you an assignment for financial reasons or smth.

Thank you for understanding. I do not. Multiple people are complaining and you choose to ignore this. Instead of working together with other developers to help you report/fix bugs in the module you are supposed to maintain I guess, you choose to alienate them.

Whatever.

To al other developers experiencing this: For our client we have locked the address fields to be filled first before choosing a service point. I suggest you do the same. Pm me if you need an example on how to. I will close this ticket since both sendcloud & their developers cant be arsed