Request - Don't hardcode new product variant settings

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anni tempo fa
Not sure if this is the right place for feature requests, but here goes:

In ProductController there's a method called FirstVariant_PrepareProductVariantModel.  It's marked private, so there's no easy way to override it in a plugin.  I'd have to re-implement the entire controller to change the functionality.

The problem is that these defaults are set to hard-coded values:

                model.MaximumCustomerEnteredPrice = 1000;
                model.MaxNumberOfDownloads = 10;
                model.RecurringCycleLength = 100;
                model.RecurringTotalCycles = 10;
                model.StockQuantity = 10000;
                model.NotifyAdminForQuantityBelow = 1;
                model.OrderMinimumQuantity = 1;
                model.OrderMaximumQuantity = 10000;

These are far off from what I need.  I sell single unique items, so every product has to have stock set to 1, notify admin to 0 , max quantity to 1, etc.  Also, the LowStockActivityId should be set here, which for me is the value associated with the "unpublish" feature.  All of this is required when you sell unique items - otherwise multiple people could order the same thing and you only have one of them.

IMHO - a plugin or custom code or manipulating this class is not the best idea.  All of the defaults for new product variants should be in settings.  It would would be great if there was an admin UI for this, but at minimum they should be available to be changed from the "All Settings" page.

Please consider adding settings for this for nopCommerce 2.30.
12 anni tempo fa
Just to clarify, for my scenario, these are the important settings:

                model.ManageInventoryMethodId = 1;
                model.StockQuantity = 1;
                model.MinStockQuantity = 1;
                model.LowStockActivityId = 2;
                model.NotifyAdminForQuantityBelow = 0;
                model.OrderMinimumQuantity = 1;
                model.OrderMaximumQuantity = 1;

These, and the others in this method should be configured from settings.  Thanks.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.