Using Dynamic vs Static Product Pricing

Using Dynamic vs Static Product Pricing

在Product Page,ATG 支持两种定价模式,即动态和静态定价方式:

 

 静态定价工作流程:

catalog每一个item都有一个listPrice 属性,然后你可以在shopping cart,order,tax使用它作为基本价格进行计算,你也可以给每一个item一个固定的价格salePrice ,在product page 你可以直接使用。

 

<dsp:droplet name="/atg/dynamo/droplet/Switch">
<dsp:param param="sku.onSale" name="value"/>
<dsp:oparam name="false">
List price of <dsp:valueof param="sku.listPrice" converter="currency"/>
</dsp:oparam>
<dsp:oparam name="true">
List price of <dsp:valueof param="sku.listPrice" converter="currency"/>
on sale for <dsp:valueof param="sku.salePrice" converter="currency"/>!
</dsp:oparam>
</dsp:droplet>

 

动态定价的工作方式:

Commerce会使用一下的机构对每一种类型进行定价:

1 Pricing Engine

2 One or more calculators

3 a helper method in the qualifier service

4 an item-descriptor in the promotions repository

 

How Price Services Generate the Prices?

1 首先会给予2个基本的组件:price engine and price caculators

2 价格引擎做的事:

取得站点访问者的有效的promotions

决定采用哪一个价格计算器计算价格

采用正确的顺序调用计算器

3 价格计算器主要负责:

查询价格

使用价格引擎得到的信息,然后决定价格

 

4 在定价以前,以下的一些步骤会发生:

  • 价格引擎会加载全局的promotions,使用globalPromotionsQuery 属性去查询
  • 用户session 开始的时候,会创建PriceModelHolder实例,然后调用价格引擎的getPricingModes();
  • pricing engine getPricingModels() method gets any promotions listed in the activePromotions
    property of the current customer’s profile, 并且和全局的epromotions进行一个merge
  • PricingModelHolder 将会定期更新全局的和active promotions

当用户添加一个item到shopping cart 会发生什么?

1 业务逻辑层调用价格引擎

2 定价操作然后调用PricingTools ,接着得到PricingModelHolder

3 PricingTools从PricingModelHolder 得到promotions,然后调用价格引擎的priceItems方法

4 价格引擎接着应用它配置的precalculators,不同种类的价格引擎会调用不同precalculators,比如OrderPricingEngineImpl calls OrderPricingCalculators and the TaxPricingEngineImpl calls
TaxPricingCalculators.

5 价格引擎接着应用它配置的postcalculators

6 价格引擎最后返回更新的priceInfo 对象

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值