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

[4.x]: Selecting an address as shipping address changes its title #3204

Closed
freder opened this issue Jun 26, 2023 · 3 comments
Closed

[4.x]: Selecting an address as shipping address changes its title #3204

freder opened this issue Jun 26, 2023 · 3 comments
Assignees
Labels
commerce4 Issues related to Commerce v4

Comments

@freder
Copy link

freder commented Jun 26, 2023

What happened?

Description

when selecting an address as shipping address, its title gets changed from whatever it currently is to Shipping Address. – why though? I already know it's the shipping address, because $order->shippingAddress. and in my case I do want to know the original title.

Screenshot 2023-06-26 at 12 42 19

Craft CMS version

4.4.14

Craft Commerce version

4.2.11

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@freder freder added commerce4 Issues related to Commerce v4 bug labels Jun 26, 2023
@nfourtythree
Copy link
Contributor

Hi @freder

Thank you for your message.

This is all by design to make sure things stay consistent and do not cause any confusion.

As an example if a user was to save an address with the label "Billing" in their address book. Then they selected that address to use as a shipping address on a cart. Retrieving that address under the shippingAddress property could potentially cause confusion when the label would say "Billing"

If you do require retrieving the "original" label, when a user chooses and address from their address book for a cart/order the ID of the source address is stored in the sourceBillingAddressId and sourceShippingAddressId properties on the order element. You could use these to retrieve the address element and check/display its title property.

Hope this helps, thanks!

@nfourtythree nfourtythree removed the bug label Jul 3, 2023
@freder
Copy link
Author

freder commented Jul 3, 2023

thanks for clarifying

This is all by design to make sure things stay consistent and do not cause any confusion.

it did the opposite for me: I was confused by this counterintuitive behavior. consistency to me means data that hasn't been touched also doesn't magically change

As an example if a user was to save an address with the label "Billing" in their address book. Then they selected that address to use as a shipping address on a cart. Retrieving that address under the shippingAddress property could potentially cause confusion when the label would say "Billing"

I think we're in agreement here: $order->shippingAddress should always be labelled shipping address. – but for that you don't have to change the data. the template would simply label the address type accordingly and could choose to display the user-given title or not.

If you do require retrieving the "original" label, when a user chooses and address from their address book for a cart/order the ID of the source address is stored in the sourceBillingAddressId and sourceShippingAddressId properties on the order element. You could use these to retrieve the address element and check/display its title property.

added another field, nbd.

@nfourtythree
Copy link
Contributor

Thank you for your feedback @freder it is really appreciated.

We will take this onboard when considering any future changes to this functionality.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commerce4 Issues related to Commerce v4
Projects
None yet
Development

No branches or pull requests

2 participants