Reorder products Problem in nopV1.80

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 anos atrás
hi..

in my order history i have two product with order id 101(product a,b and qty for a=10).

in between i was choosed product "a" again and added it to shopping cart with qty=30

here in order history i choosed order details for order id=101 it will show the details and when i click the reorder button it should show only the 0rder id 101 products in "shoppingcart.aspx"

but it shows current shopping cart products and my reorder products..

and also if my shooping cart product and my reorder products are same means then it adds the both quantites and show
it as a single row(ex.product a qty=30+10=40)

so how to tackle the reorder problem..

need ur suggestions

regards
gopal.s
13 anos atrás
It's the default behaviour. Follow the next steps in order to customziae nopCommerce 1.80 for your needs
1. Open \Libraries\Nop.BusinessLogic\Orders\OrderManager.cs file
2. Find public static void ReOrder(int orderId) method
3. Replace it with
public static void ReOrder(int orderId)
        {
            var order = GetOrderById(orderId);
            if(order != null)
            {
                var cart = ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart);
                foreach (var sci in cart)
                {
                        ShoppingCartManager.DeleteShoppingCartItem(sci.ShoppingCartItemId, false);
                }
                foreach (var orderProductVariant in order.OrderProductVariants)
                {
                    ShoppingCartManager.AddToCart(ShoppingCartTypeEnum.ShoppingCart,
                        orderProductVariant.ProductVariantId,
                        orderProductVariant.AttributesXml,
                        orderProductVariant.UnitPriceExclTax,
                        orderProductVariant.Quantity);
                }
            }

        }
P.S. Not tested
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.