Skip to content

Existing ShoppingCartItem Quantity Doubled After Calling "CreateOrder" #182

@pkmccaffrey

Description

@pkmccaffrey

When calling OrdersController.CreateOrder(), the quantity for any already existing ShoppingCartItem object is doubled.

The issue is in OrdersController.AddOrderItemsToCart(). When calling _shoppingCartService.AddToCart(), Nop assumes that you want to increase the quantity of any pre-existing cart items by the specified amount. This code is called strictly from CreateOrder, so it can be assumed that the quantity submitted for a given OrderItemDto is the desired quantity (and any existing quantity on a ShoppingCartItem should be ignored).

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