Override every instance of a model?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
If I wanted to write a plugin, that made every Product return a StockQuantity of 5, how would I do that?  If I have a partial class like this - how do I get nopCommerce to use it every time instead of the original Product class?


public partial class ModifiedProduct : Product
    {
        private int _stockQuantity;

        public new int StockQuantity
        {
            get
            {
                return 5;
            }

            set
            {
                this._stockQuantity = value;
            }
            
        }
    }
5 years ago
IT would be good if you explain why you need this and where you need to use the quantity 5 variable.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.