オープンカートでモジュールを作成していて、価格計算がどのように行われるかを知る必要があり、このコードに出くわしました
$price = $this->currency->format($this->tax->calculate($result['price'],
$result['tax_class_id'], $this->config->get('config_tax')));
if ((float)$result['special']) {
$special = $this->currency->format($this->tax->calculate(
$result['special'],
$result['tax_class_id'], $this->config->get('config_tax')));
} else {
$special = false;
}
if ($this->config->get('config_tax')) {
$tax = $this->currency->format((float)$result['special'] ?
$result['special'] : $result['price']);
} else {
$tax = false;
}
実際、ここで実際に何が起こっているのかわかりませんでした。ととの間に実際には違いがないことがわかりますが$price
、$special
この$tax
ように実装されているのには理由があるはずです。
私はここで何かが欠けていると確信しています誰かがopencartで価格計算がどのように行われるかを私に説明しますか?