Skip to content

Delete Coupons Function #119

Description

@campmedia

Hey, based on the build coupon elements, the "remove coupon" function should getAttribute of 'data-coupon-pos' not just 'data-pos'. on Line #2504 ;)

 * button click event signaling that a coupon should be removed from the shopping cart.
 * The button should have a data-coupon-pos attribute providing the coupon position in the cart coupons array.
 * @param event
 */
function removeCoupon(event) {
    var button = event.target;
    var position = parseInt(button.getAttribute('data-coupon-pos'));

    if (uc.cart && uc.cart.coupons && uc.cart.coupons.length > position) {
        uc.cart.coupons.splice(position, 1);
        uc.saveCart();
    }
}

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