EC-CUBE / EC-CUBE/doc4.ec-cube.net

加算ポイントの計算ロジックの詳細が欲しい

Open
#18 0 comments 2 reactions 0 assignees View on GitHub
Functions
Dominant language
HTML
Stars
16
Forks
63
PR merge metrics
No merged PRs in 30d

Description

ポイントの計算方法の詳細をわかるようにしたい。
今ページを作る時間がないので、調査情報だけ書いておきます。

## 計算対象

- 商品明細
- 割引明細
- ポイント明細

## 計算ロジック

`ポイント = 単価 * ポイント付与率 * 数量`

ただし `単価 * ポイント付与率` で四捨五入される。

### 例

ポイント付与率1%で1個999円の商品を10個購入する場合
商品ごとの付与ポイント = 940円/商品 * 1% = 9.4ポイント/商品 --(四捨五入)-> 9ポイント/商品
全体のポイント = 9ポイント/商品 * 10商品 = 90ポイント

※94ポイントにはならない

https://github.com/EC-CUBE/ec-cube/blob/ea5c56f89f6e76e104e5bc4f390e8a229b34186b/src/Eccube/Service/PurchaseFlow/Processor/AddPointProcessor.php#L70-L93

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.