Display Stock Availability

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
When I set the manage stock option to "Track inventory for this variant by product attributes" the options to display stock availability and display stock quantity disappear. When I view the product that has size & colour variants with varying stock levels the stock level & availability are not displayed. I can't see anythign in the variant config to set the display of the stock level. How can I display the stock level for product variants with size/colour? I'm using the demo store that comes with 1.80
13 years ago
To disable stock check we change :

Nop.BusinessLogic.dll

NopSolutions.NopCommerce.BusinessLogic.Orders


line 820

            switch ((ManageInventoryMethodEnum)productVariant.ManageInventory)
            {
                case ManageInventoryMethodEnum.DontManageStock:
                    {
                    }
                    break;
                case ManageInventoryMethodEnum.ManageStock:
                    {
                        if ((BackordersModeEnum)productVariant.Backorders == BackordersModeEnum.NoBackorders)
                        {
                            if (productVariant.StockQuantity < quantity)
                            {
                                int maximumQuantityCanBeAdded = productVariant.StockQuantity;
                                //if (maximumQuantityCanBeAdded <= 0)
                                    //warnings.Add(IoC.Resolve<ILocalizationManager>().GetLocaleResourceString("ShoppingCart.OutOfStock"));
                                //else
                                   // warnings.Add(string.Format(IoC.Resolve<ILocalizationManager>().GetLocaleResourceString("ShoppingCart.QuantityExceedsStock"), maximumQuantityCanBeAdded));
                            }
                        }
                    }
                    break;
                case ManageInventoryMethodEnum.ManageStockByAttributes:
                    {
                        var combination = IoC.Resolve<IProductAttributeService>().FindProductVariantAttributeCombination(productVariant.ProductVariantId, selectedAttributes);
                        if (combination != null)
                        {
                            if (!combination.AllowOutOfStockOrders)
                            {
                                if (combination.StockQuantity < quantity)
                                {
                                    int maximumQuantityCanBeAdded = combination.StockQuantity;
                                    //if (maximumQuantityCanBeAdded <= 0)
                                        //warnings.Add(IoC.Resolve<ILocalizationManager>().GetLocaleResourceString("ShoppingCart.OutOfStock"));
                                    //else
                                        //warnings.Add(string.Format(IoC.Resolve<ILocalizationManager>().GetLocaleResourceString("ShoppingCart.QuantityExceedsStock"), maximumQuantityCanBeAdded));
                                }
                            }
                        }
                    }
                    break;
                default:
                    break;
            }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.