0
的Prestashop 1.6.1.10的Prestashop 1.6產品使用custome團體折扣
當創建與組合和客戶羣的折扣產品,該產品頁面顯示不打折時的價格顯示錯誤的價格組合。
但是,當您將產品添加到購物車時,折扣適用。
參見a product with combination and group discount
的Prestashop 1.6.1.10的Prestashop 1.6產品使用custome團體折扣
當創建與組合和客戶羣的折扣產品,該產品頁面顯示不打折時的價格顯示錯誤的價格組合。
但是,當您將產品添加到購物車時,折扣適用。
參見a product with combination and group discount
我通過在控制器下面的代碼變化解決\前\ ProductController.php
add函數:
protected function getGroupReduction() {
$id_customer = (isset($this->context->customer) ? (int)$this->context->customer->id : 0);
$id_group = (int)Group::getCurrent()->id;
$id_country = $id_customer ? (int)Customer::getCurrentCountry($id_customer) : (int)Tools::getCountry();
$group_reduction = GroupReduction::getValueForProduct($this->product->id, $id_group);
if ($group_reduction === false) {
$group_reduction = Group::getReduction((int)$this->context->cookie->id_customer)/100;
}
return $group_reduction;
}
更換線467:
$combinations[$row['id_product_attribute']]['price'] = (float)Tools::convertPriceFull($row['price'], null, Context::getContext()->currency, false);
有以下幾行:
$group_reduction = $this->getGroupReduction();
$price = $row['price'] - $row['price']* $group_reduction;
$combinations[$row['id_product_attribute']]['price'] = (float)Tools::convertPriceFull($price, null, Context::getContext()->currency, false);