Skip to content

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

@jaminion

Description

@jaminion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions