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

Basket Edit link not loading attribute values due to casing #134

Open
jaminion opened this issue Mar 28, 2024 · 0 comments
Open

Basket Edit link not loading attribute values due to casing #134

jaminion opened this issue Mar 28, 2024 · 0 comments

Comments

@jaminion
Copy link

NOTE: we tend to use uppercased codes for attributes, if using lowercased codes this wouldn't be noticeable.

Also - I'm not sure if you guys are taking issues here anymore, I believe the proper dev is being done through https://github.com/mivaecommerce/shadows now and that does not have an accessible issue queue. Anyway, just hoping to help, have a great day!

Expected Behavior

With product with two attributes (size/color), when clicking the Edit link for an item in the cart it should load the currently selected attribute options for the two attributes for that item.

Current Behavior

The attributes would always load set to their defaults.

Attempted Fixes

I edited line https://github.com/mivaecommerce/shadows/blob/023c4f665fbb0cfb106c13dc92be65ecf02e04e0/mmt/js/edit-basket-attributes.mvt#L43 to remove the .toLowerCase() from the key var inside the querySelectorAll() call. This appeared to fix the issue in our case. Our selects were tagged as data-attribute="SIZE", rather than data-attribute="size". Either way the expected casing if it is getting transformed just needs to be aligned.

Steps to Reproduce (for bugs)

Create product with at least one select/dropdown attribute using a code that is uppercased, with multiple values. Put an item with a not-default value set for it in the basket, go to edit the basket and hit the Edit button, check the selected attribute values. There is another store that we had been running several months where we had not noticed this.

Context

How has this issue affected you?

It's arguably not a stopper, however when you have the size set as a simple dropdown and using swatches for colors, it's much greater potential for someone to edit their item in the cart to switch colors without noticing that the size is being changed as well (they've already confirmed it when they added it to the cart). When they receive their order they will be wanting a return. When we produce things on-demand returns are much more costly. Sure most people are going to notice it, but every little bit helps (or hurts).

Your Environment

Store had recent shadows framework version 10.08.02 applied. It doesn't look like mivaecommerce/shadows@10.08.02...10.08.03 changes anything related, but it very well could, I just cannot test that easily at the moment.

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

No branches or pull requests

1 participant