Skip to content

Remove / Edit Item in minicart does not work if span css is changed #1694

Closed
@Zaylril

Description

@Zaylril

Hey,

On our design we removed the span styles from the minicart "remove" and "edit" links which add the icon. This means that, because the span now has no styles (just shows the text) when you click the link the code in the JS to remove the item now finds the span not the a tag which contains the item id to remove and be sent with the post.

This took me a while to debug and I'm sure others may fall into the same trap. Perhaps something like this would be better.

        _removeItem: function(elem) {
            if(elem.prop('tagName') !== 'A') {
                elem = elem.parent('a');
            }
            var itemId = elem.data('cart-item');
            this._ajax(this.options.url.remove, {
                item_id: itemId
            }, elem, this._removeItemAfter);
        },

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions