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

Investigate display of the "change address" link in the cart block #42280

Closed
mikejolley opened this issue Jul 24, 2023 · 24 comments · Fixed by #43803
Closed

Investigate display of the "change address" link in the cart block #42280

mikejolley opened this issue Jul 24, 2023 · 24 comments · Fixed by #43803
Assignees
Labels
block: cart Issues related to the cart block. focus: cart Issues related to the cart. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: bug The issue is a confirmed bug. type: refactor The issue/PR is related to refactoring.

Comments

@mikejolley
Copy link
Member

We've had a few issues around the visibility of the change address link under the cart block and need to investigate what could lead to this happening

Tickets:

There are also some things that were worked on in the past seemingly missing from the current build, for example this change from @tarunvijwani which doesn't actually exist in trunk:

No, if there is any shipping method that is applicable for all the shipping locations then it will not display the shipping calculator at all. This was discussed in the woocommerce/woocommerce-blocks#8141 (comment)

woocommerce/woocommerce-blocks#9025 (comment)

Tarun is creating an RFC for this, but my suggestion would be to:

  • Check that the "change address" button displays under all circumstances if enabled at block level. If a merchant has a setup which would make that redundant (e.g. one shipping zone) I feel we should leave it to them to disable the link rather than implement logic that makes it behave different to the settings
  • Ensure the block level display setting syncs up to the global setting. We could discuss removing or hiding the global setting to avoid confusion here
  • Check that extensions do not have the power to remove the link
  • Add unit tests that cover a variety of carts and confirm the link is active

cc @ralucaStan for visibility

@emcgal
Copy link

emcgal commented Jul 24, 2023

Just reposting this here too @mikejolley

The option to even enter the address in the basket is no longer there. Just shows the shipping options which are set to Ireland by default as most customers are coming from Ireland. In the past we were able to change it and it is still available on another client website I still have full access too that used the postcode in Dublin. It is showing on theirs and I can't see any difference in the settings so I am starting to wonder has something become corrupt?

Most of my clients don't bother with shipping abroad anymore with the costs so I'm limited in what I can compare to.

I will try to do a screen record asap for you.

@mikejolley
Copy link
Member Author

mikejolley commented Jul 24, 2023

@emcgal thanks that would be useful. Even with the shipping calculator not there, you should still see correct quotes during checkout as the shipping address is input. If thats not happening I'd assume its either an extension at fault, or something to do with the shipping zone/methods setup. Maybe some screenshots of that would help too so we can reproduce.

@tarunvijwani
Copy link
Contributor

At the moment, the shipping calculator is hidden when they only have 1 shipping zone, regardless of the merchant’s preference. We need to ensure that the shipping calculator is displayed all the time if the merchant has enabled it.
For more details, refer to the RFC post: pdFofs-1c5-p2

@ralucaStan
Copy link
Contributor

Moving this to the next cycle column. cc @pmcpinto

@emcgal
Copy link

emcgal commented Sep 5, 2023

@mikejolley Trying to follow this between a lot of threads and I was away a lot over the summer months so apologies for missing things.

Is this resolved?

@ralucaStan
Copy link
Contributor

It's not fixed yet @emcgal, only when the ticket gets closed will this issue be considered fixed, with an attached PR that pushed some code to fix it.

We are currently having an internal discussion around the shipping calculator use cases. Based on those discoveries we will proceed with a fix. pdFofs-1qj-p2

@emcgal
Copy link

emcgal commented Sep 6, 2023

Thanks @ralucaStan. I have had so many closed and merging notifications, it is really hard to follow when I login. For some reason I am not getting emails for mention and I do have it selected. I only get emails when the status is changed so makes it harder to follow. Must look into it.

@ralucaStan
Copy link
Contributor

In pdFofs-1qj-p2#comment-1795 we decided to revert the change in woocommerce/woocommerce-blocks#8141 PR to hide the change shipping address link and to explore if it’s possible to tweak the core setting logic to only show the shipping calculator when there are location-dependent shipping methods, as we think this creates a better shopper experience.

@ralucaStan
Copy link
Contributor

My suggestion is to keep this ticket and only use it to revert the changes from woocommerce/woocommerce-blocks#8141.

A separate ticket with lower priority should be opened to explore if it’s possible to tweak the core setting logic to only show the shipping calculator when there are location-dependent shipping methods.

@tarunvijwani
Copy link
Contributor

Just noting the observations from woocommerce/woocommerce-blocks#11442, the shipping calculator is not visible in the following condition:

  • no default location
  • location-specific methods and fallback methods enabled

More details are available on this woocommerce/woocommerce-blocks#11442 (comment)

@senadir senadir added the team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues label Nov 28, 2023
@nerrad nerrad added the focus: cart Issues related to the cart. label Nov 29, 2023
@ObliviousHarmony ObliviousHarmony transferred this issue from woocommerce/woocommerce-blocks Dec 11, 2023
@pmcpinto
Copy link

My suggestion is to keep this ticket and only use it to revert the changes from woocommerce/woocommerce-blocks#8141

Is it possible to revert the changes before the end of the cycle?

@opr
Copy link
Contributor

opr commented Dec 20, 2023

Is it possible to revert the changes before the end of the cycle?

Due to the monorepo merge, simply reverting the changes in that PR is hard, I don't know what specific part needs to be reverted and files have been changed since it was merged. @tarunvijwani do you have any hints about what specifically needs to be changed back from that PR woocommerce/woocommerce-blocks#8141?

@tarunvijwani
Copy link
Contributor

Thank you for reaching out, @opr! I appreciate it. Yes, the file has been changed, and it will be difficult to undo the changes made. The addressComplete variable and isAddressComplete function were introduced and are responsible for displaying or hiding the shipping calculator and that needs to be reverted.

However, I suggest that we reconsider reverting the PR as we have fixed some scenarios in the past few months. Instead, we should focus on fixing the scenarios where the shipping calculator is not working correctly, and we should carefully consider when it should be visible or hidden.

@ralucaStan
Copy link
Contributor

However, I suggest that we reconsider reverting the PR as we have fixed some scenarios in the past few months. Instead, we should focus on fixing the scenarios where the shipping calculator is not working correctly, and we should carefully consider when it should be visible or hidden.

@tarunvijwani is this something you can help with defining for the scope of a new issue?

@tarunvijwani tarunvijwani self-assigned this Jan 5, 2024
@tarunvijwani
Copy link
Contributor

@ralucaStan Sure, I have picked the issue and will continue in this cycle.

@pmcpinto
Copy link

pmcpinto commented Jan 5, 2024

@tarunvijwani do you think it's doable to target the next Core code freeze? Jan 24th

@tarunvijwani
Copy link
Contributor

Yes, I will be able to carry out the investigation and wrap up the task before January 24th.

@tarunvijwani
Copy link
Contributor

@pmcpinto @elizaan36 I have investigated all the scenarios for the "Change Address" link and prepared a document: https://docs.google.com/document/d/1spdQXB_gH4AeVftkWeoUBw7jq-jmkR_byDL6xKG8iOQ/

I'd appreciate it if you could take a look and suggest the required changes for any given scenario.

I have highlighted some scenarios that need some extra attention and added comments. I feel we should we should display and hide the "Change Address" link below scenarios:

  • When Default customer location is set to No default location
    • Multiple shipping zones and fallback shipping zone: A merchant can have paid fallback shipping zone and free shipping at some specific locations; we should allow the shopper to change the address and check the relevant shipping fee.
    • We'd need some design input here as when the store doesn't have the address, what text it should display for the change address link along with the fallback shipping options.
  • Shop with no shipping zones defined:
    • We should hide the "Change Address" link from the editor in this scenario as it will not be visible to guest and existing shopper on the front-end.

Looking forward to hearing back from you.

@pmcpinto
Copy link

@tarunvijwani thanks for creating the Google Doc. It's very useful.

we should allow the shopper to change the address and check the relevant shipping fee.

Makes sense. I think we could re-use the copy we have in the shortcode: Enter your address to view shipping options

@elizaan36 what do you think?

We should hide the "Change Address" link from the editor in this scenario as it will not be visible to guest and existing shopper on the front-end.

Sounds good to me.

@tarunvijwani
Copy link
Contributor

tarunvijwani commented Jan 18, 2024

@pmcpinto I feel "Enter your address to view shipping options" might be confusing as we are displaying the shipping option right below it. How about we change the text to "Change address to view shipping options for your location" or something shorter?

option 1 option 2
image image

@pmcpinto
Copy link

How about we change the text to "Change address to view shipping options for your location" or something shorter?

Sounds good to me. cc @elizaan36 @nikkivias in case you have feedback

@elizaan36
Copy link
Contributor

elizaan36 commented Jan 19, 2024

@tarunvijwani Thank you for this comprehensive doc with consideration for the "Default customer location" setting.

When Default customer location is set to No default location
Multiple shipping zones and fallback shipping zone: A merchant can have paid fallback shipping zone and free shipping at some specific locations; we should allow the shopper to change the address and check the relevant shipping fee.

I can see the logic of the shortcode checkout approach in this case: "Shipping options will be updated during checkout. Calculate shipping"

It's a concise way of communicating that this shipping rate may not be correct and we'll need your actual address in order to calculate it.

When Default customer location is set to No default location
We'd need some design input here as when the store doesn't have the address, what text it should display for the change address link along with the fallback shipping options.

This use case could use the same approach as the shortcode checkout as well.

However, Tarun's idea here could work as well:

How about we change the text to "Change address to view shipping options for your location" or something shorter?

A shorter option could be, "Calculate shipping for your location". This could work for the use cases where the address isn't known but shipping zones do exist.

Shop with no shipping zones defined:
We should hide the "Change Address" link from the editor in this scenario as it will not be visible to guest and existing shopper on the front-end.

+1. The editor should reflect the front end experience and not show the link. This would apply to all use cases, regardless of how the "Default customer location" is set.

@elizaan36
Copy link
Contributor

One more thing, in the scenarios mentioned above where the shopper has no default location the merchant may have checked the setting to "Hide shipping costs until an address is entered", in which case it would only show the link to Enter an address.

image

@tarunvijwani
Copy link
Contributor

Thank you for your suggestions. I'll include them in the PR. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block: cart Issues related to the cart block. focus: cart Issues related to the cart. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: bug The issue is a confirmed bug. type: refactor The issue/PR is related to refactoring.
Projects
None yet
9 participants