Я возможно нашел, но смысл в чем. Мне нужно, что бы конечная стоимость считалась от стоимости за единицу товара. Параметр $unit_price
PHP я знаю поверхностно, простая замена переменной не помогла. Пожалуйста, подскажите.
// Here taxes are computed only once the quantity has been applied to the product price $price = Product::getPriceStatic( (int)$product['id_product'], false, (int)$product['id_product_attribute'], 2, null, false, true, $product['cart_quantity'], false, (int)$this->id_customer ? (int)$this->id_customer : null, (int)$this->id, $address_id, $null, true, true, $virtual_context );
$total_ecotax = $product['ecotax'] * (int)$product['cart_quantity']; $total_price = $price * (int)$product['cart_quantity'];
if ($with_taxes) { $product_tax_rate = (float)Tax::getProductTaxRate((int)$product['id_product'], (int)$address_id, $virtual_context); $product_eco_tax_rate = Tax::getProductEcotaxRate((int)$address_id);
$total_price = ($total_price - $total_ecotax) * (1 + $product_tax_rate / 100); $total_ecotax = $total_ecotax * (1 + $product_eco_tax_rate / 100); $total_price = Tools::ps_round($total_price + $total_ecotax, 2); } } else { if ($with_taxes) $price = Product::getPriceStatic( (int)$product['id_product'], true, (int)$product['id_product_attribute'], 2, null, false, true, $product['cart_quantity'], false, ((int)$this->id_customer ? (int)$this->id_customer : null), (int)$this->id, ((int)$address_id ? (int)$address_id : null), $null, true, true, $virtual_context ); else $price = Product::getPriceStatic( (int)$product['id_product'], false, (int)$product['id_product_attribute'], 2, null, false, true, $product['cart_quantity'], false, ((int)$this->id_customer ? (int)$this->id_customer : null), (int)$this->id, ((int)$address_id ? (int)$address_id : null), $null, true, true, $virtual_context );
$total_price = Tools::ps_round($price * (int)$product['cart_quantity'], 2); } $order_total += $total_price; }
$order_total_products = $order_total;
if ($type == Cart::ONLY_DISCOUNTS) $order_total = 0;
Заранее спасибо!
|