本文整理汇总了PHP中Customization::getCustomizationPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP Customization::getCustomizationPrice方法的具体用法?PHP Customization::getCustomizationPrice怎么用?PHP Customization::getCustomizationPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customization
的用法示例。
在下文中一共展示了Customization::getCustomizationPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: priceCalculation
//.........这里部分代码省略.........
self::$_pricesLevel2[$cache_id_2][(int) $row['id_product_attribute']] = $array_tmp;
if (isset($row['default_on']) && $row['default_on'] == 1) {
self::$_pricesLevel2[$cache_id_2][0] = $array_tmp;
}
}
}
}
if (!isset(self::$_pricesLevel2[$cache_id_2][(int) $id_product_attribute])) {
return;
}
$result = self::$_pricesLevel2[$cache_id_2][(int) $id_product_attribute];
if (!$specific_price || $specific_price['price'] < 0) {
$price = (double) $result['price'];
} else {
$price = (double) $specific_price['price'];
}
// convert only if the specific price is in the default currency (id_currency = 0)
if (!$specific_price || !($specific_price['price'] >= 0 && $specific_price['id_currency'])) {
$price = Tools::convertPrice($price, $id_currency);
if (isset($specific_price['price']) && $specific_price['price'] >= 0) {
$specific_price['price'] = $price;
}
}
// Attribute price
if (is_array($result) && (!$specific_price || !$specific_price['id_product_attribute'] || $specific_price['price'] < 0)) {
$attribute_price = Tools::convertPrice($result['attribute_price'] !== null ? (double) $result['attribute_price'] : 0, $id_currency);
// If you want the default combination, please use NULL value instead
if ($id_product_attribute !== false) {
$price += $attribute_price;
}
}
// Customization price
if ((int) $id_customization) {
$price += Customization::getCustomizationPrice($id_customization);
}
// Tax
$address->id_country = $id_country;
$address->id_state = $id_state;
$address->postcode = $zipcode;
$tax_manager = TaxManagerFactory::getManager($address, Product::getIdTaxRulesGroupByIdProduct((int) $id_product, $context));
$product_tax_calculator = $tax_manager->getTaxCalculator();
// Add Tax
if ($use_tax) {
$price = $product_tax_calculator->addTaxes($price);
}
// Eco Tax
if (($result['ecotax'] || isset($result['attribute_ecotax'])) && $with_ecotax) {
$ecotax = $result['ecotax'];
if (isset($result['attribute_ecotax']) && $result['attribute_ecotax'] > 0) {
$ecotax = $result['attribute_ecotax'];
}
if ($id_currency) {
$ecotax = Tools::convertPrice($ecotax, $id_currency);
}
if ($use_tax) {
// reinit the tax manager for ecotax handling
$tax_manager = TaxManagerFactory::getManager($address, (int) Configuration::get('PS_ECOTAX_TAX_RULES_GROUP_ID'));
$ecotax_tax_calculator = $tax_manager->getTaxCalculator();
$price += $ecotax_tax_calculator->addTaxes($ecotax);
} else {
$price += $ecotax;
}
}
// Reduction
$specific_price_reduction = 0;
if (($only_reduc || $use_reduc) && $specific_price) {