How to set prices dynamically : nopcommerce

222 views Asked by At

I have created a plugin for NOPCommerce system. The admin add/attach pricing table to the product and store information in new table. Since, i don't wanted to override the original price for the product rather i will change it dynamically.

Because different USERcan select different pricing plan when adding product to cart.

Same example : https://www.nopcommerce.com/en/boards/topic/45339/dynamic-pricing-based-on-textbox-product-attributes

If there is any idea/solution related to dynamic price handling for nopcommerce stores, please let me know. Thanks for your time.

1

There are 1 answers

0
Fatih Eker On

You can implement your own pricing logic in your plugin with overriding one of the PriceCalculationSerivce or TaxService services.

Tip: Add this line in Dependency registrar

namespace Nop.Plugin.Misc.MyNewMethod
{
    public class DependencyRegistrar : IDependencyRegistrar
    {
        public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config)
        {
            builder.RegisterType<NewServiceMyPlugin>().As<IPriceCalculationSerivce>().InstancePerLifetimeScope();
        }
        public int Order
        {
            get
            {
                return 10;
            }
        }
    }
}