簡體   English   中英

如何動態設置價格:nopcommerce

[英]How to set prices dynamically : nopcommerce

我為NOPCommerce系統創建了一個插件。 admin add/attach pricing table到產品並將信息存儲在新表中。 因為,我不想override the original price ,而是動態更改它。

因為不同的USER在將產品添加到購物車時可以 select 不同的定價計划。

相同示例: https://www.nopcommerce.com/en/boards/topic/45339/dynamic-pricing-based-on-textbox-product-attributes

如果有任何與 nopcommerce 商店的動態價格處理相關的想法/解決方案,請告訴我。 謝謝你的時間。

您可以通過覆蓋 PriceCalculationSerivce 或 TaxService 服務之一在插件中實現自己的定價邏輯。

提示:在 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;
            }
        }
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM