本文整理汇总了PHP中zen_get_attributes_price_final_onetime函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_get_attributes_price_final_onetime函数的具体用法?PHP zen_get_attributes_price_final_onetime怎么用?PHP zen_get_attributes_price_final_onetime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_get_attributes_price_final_onetime函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: convert_product_attributes_result
function convert_product_attributes_result($attributes_values, $load_option_name = true, $can_operate = false)
{
if ($load_option_name) {
$attributes_values->fields['products_options_name'] = zen_options_name($attributes_values->fields['options_id']);
$attributes_values->fields['products_options_values_name'] = zen_values_name($attributes_values->fields['options_values_id']);
}
$attributes_values->fields['products_display_price'] = $attributes_values->fields['price_prefix'] . $attributes_values->fields['options_values_price'];
$attributes_values->fields['products_attributes_display_weight'] = $attributes_values->fields['products_attributes_weight_prefix'] . $attributes_values->fields['products_attributes_weight'];
require_once DIR_WS_CLASSES . 'currencies.php';
$currencies = new currencies();
$attributes_price_final = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, $attributes_values, 'false');
$attributes_price_final_value = $attributes_price_final;
$attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate(1), 1);
$attributes_price_final_onetime = zen_get_attributes_price_final_onetime($attributes_values->fields["products_attributes_id"], 1, $attributes_values);
$attributes_price_final_onetime = $currencies->display_price($attributes_price_final_onetime, zen_get_tax_rate(1), 1);
$new_attributes_price = '';
if ($attributes_values->fields["attributes_discounted"]) {
$new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false');
$new_attributes_price = zen_get_discount_calc($attributes_values->fields['products_id'], true, $new_attributes_price);
if ($new_attributes_price != $attributes_price_final_value) {
$new_attributes_price = '|' . $currencies->display_price($new_attributes_price, zen_get_tax_rate(1), 1);
} else {
$new_attributes_price = '';
}
}
$attributes_values->fields['attributes_display_price_final'] = $attributes_price_final . $new_attributes_price . ' ' . $attributes_price_final_onetime;
// status
$attributes_values->fields['products_status'] = "";
foreach ($this->statuses as $type => $icon_info) {
$attributes_values->fields['products_status'] .= self::make_status_link($attributes_values->fields, $type, $icon_info['color'], $icon_info['alt'], $can_operate);
}
return $attributes_values->fields;
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:33,代码来源:easy_admin_products_attribute_model.php
示例2: testValueOneTimePrice
/**
* Test one time price.
*/
public function testValueOneTimePrice()
{
foreach ($this->get('productService')->getAllProducts(false, 1) as $product) {
foreach ($product->getAttributes() as $attribute) {
foreach ($attribute->getValues() as $value) {
$er = error_reporting(0);
$zprice = zen_get_attributes_price_final_onetime($value->getAttributeValueDetailsId(), 1, '');
error_reporting($er);
$this->assertEquals($zprice, $value->getOneTimePrice(false), '%s productId=' . $product->getId() . ' $valueId=' . $value->getAttributeValueId());
}
}
}
}
开发者ID:zenmagick,项目名称:zenmagick,代码行数:16,代码来源:AttributePricingTest.php
示例3: zen_black_line
<tr>
<td colspan="10"><?php
echo zen_black_line();
?>
</td>
</tr>
<tr>
<?php
} else {
// attributes display listing
// calculate current total attribute price
// $attributes_values
$attributes_price_final = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, $attributes_values, 'false');
$attributes_price_final_value = $attributes_price_final;
$attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate($product_check->fields['products_tax_class_id']), 1);
$attributes_price_final_onetime = zen_get_attributes_price_final_onetime($attributes_values->fields["products_attributes_id"], 1, $attributes_values);
$attributes_price_final_onetime = $currencies->display_price($attributes_price_final_onetime, zen_get_tax_rate($product_check->fields['products_tax_class_id']), 1);
?>
<td class="smallText"> <?php
echo $attributes_values->fields["products_attributes_id"];
?>
</td>
<td class="smallText"> <?php
// echo $products_name_only;
?>
</td>
<td class="smallText"> <?php
echo $options_name;
?>
</td>
<td class="smallText"> <?php
开发者ID:quangn92,项目名称:visualyou,代码行数:31,代码来源:attributes_controller.php
示例4: zen_get_attributes_price_final
function zen_get_attributes_price_final($attribute, $qty = 1, $pre_selected, $include_onetime = 'false')
{
global $db;
global $cart;
if ($pre_selected == '' or $attribute != $pre_selected->fields["products_attributes_id"]) {
$pre_selected = $db->Execute("select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_attributes_id= '" . $attribute . "'");
} else {
// use existing select
}
// normal attributes price
if ($pre_selected->fields["price_prefix"] == '-') {
$attributes_price_final -= $pre_selected->fields["options_values_price"];
} else {
$attributes_price_final += $pre_selected->fields["options_values_price"];
}
// qty discounts
$attributes_price_final += zen_get_attributes_qty_prices_onetime($pre_selected->fields["attributes_qty_prices"], $qty);
// price factor
$display_normal_price = zen_get_products_actual_price($pre_selected->fields["products_id"]);
$display_special_price = zen_get_products_special_price($pre_selected->fields["products_id"]);
$attributes_price_final += zen_get_attributes_price_factor($display_normal_price, $display_special_price, $pre_selected->fields["attributes_price_factor"], $pre_selected->fields["attributes_price_factor_offset"]);
// per word and letter charges
if (zen_get_attributes_type($attribute) == PRODUCTS_OPTIONS_TYPE_TEXT) {
// calc per word or per letter
}
// onetime charges
if ($include_onetime == 'true') {
$pre_selected_onetime = $pre_selected;
$attributes_price_final += zen_get_attributes_price_final_onetime($pre_selected->fields["products_attributes_id"], 1, $pre_selected_onetime);
}
return $attributes_price_final;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:32,代码来源:functions_prices.php
示例5: zen_get_attributes_price_final
if ($products_options->fields['attributes_discounted'] == 1) {
// apply product discount to attributes if discount is on
// $new_attributes_price = $products_options->fields['options_values_price'];
$new_attributes_price = zen_get_attributes_price_final($products_options->fields["products_attributes_id"], 1, '', 'false');
$new_attributes_price = zen_get_discount_calc((int) $_GET['products_id'], true, $new_attributes_price);
} else {
// discount is off do not apply
$new_attributes_price = $products_options->fields['options_values_price'];
}
// reverse negative values for display
if ($new_attributes_price < 0) {
$new_attributes_price = -$new_attributes_price;
}
if ($products_options->fields['attributes_price_onetime'] != 0 or $products_options->fields['attributes_price_factor_onetime'] != 0) {
$show_onetime_charges_description = 'true';
$new_onetime_charges = zen_get_attributes_price_final_onetime($products_options->fields["products_attributes_id"], 1, '');
$price_onetime = TEXT_ONETIME_CHARGE_SYMBOL . $currencies->display_price($new_onetime_charges, zen_get_tax_rate($product_info->fields['products_tax_class_id']));
} else {
$price_onetime = '';
}
if ($products_options->fields['attributes_qty_prices'] != '' or $products_options->fields['attributes_qty_prices_onetime'] != '') {
$show_attributes_qty_prices_description = 'true';
$show_attributes_qty_prices_icon = 'true';
}
if ($products_options->fields['options_values_price'] != '0' and ($products_options->fields['product_attribute_is_free'] != '1' and $product_info->fields['product_is_free'] != '1')) {
// show sale maker discount if a percentage
$products_options_display_price = ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] . $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;
} else {
// if product_is_free and product_attribute_is_free
if ($products_options->fields['product_attribute_is_free'] == '1' and $product_info->fields['product_is_free'] == '1') {
$products_options_display_price = TEXT_ATTRIBUTES_PRICE_WAS . $products_options->fields['price_prefix'] . $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . TEXT_ATTRIBUTE_IS_FREE;
开发者ID:dalinhuang,项目名称:kakayaga,代码行数:31,代码来源:attributes.php
示例6: zen_get_attributes_price_final
function zen_get_attributes_price_final($attribute, $qty = 1, $pre_selected, $include_onetime = 'false')
{
global $db;
$attributes_price_final = 0;
if ($pre_selected == '' or $attribute != $pre_selected->fields["products_attributes_id"]) {
$pre_selected = $db->Execute("select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_attributes_id= '" . (int) $attribute . "'");
} else {
// use existing select
}
// normal attributes price
// Dual Pricing start
if ($_SESSION['customer_whole']) {
if ($_SESSION['customer_whole'] != '0') {
$i = (int) $_SESSION['customer_whole'];
$i--;
$option_price_array = $pre_selected->fields['options_values_price_w'];
$optionprice = explode(",", $option_price_array);
$options_values_price = (double) $optionprice[$i];
if ($options_values_price == '0' || $options_values_price == '') {
$options_values_price = (double) $optionprice[0];
}
$the_base_price += $options_values_price;
if ($options_values_price == '0') {
$options_values_price = $pre_selected->fields['options_values_price'];
}
} else {
$options_values_price = $pre_selected->fields['options_values_price'];
}
} else {
$options_values_price = $pre_selected->fields['options_values_price'];
}
if ($pre_selected->fields["price_prefix"] == '-') {
$attributes_price_final -= $pre_selected->fields["options_values_price"];
} else {
$attributes_price_final += $pre_selected->fields["options_values_price"];
// Dual Pricing end
}
// qty discounts
$attributes_price_final += zen_get_attributes_qty_prices_onetime($pre_selected->fields["attributes_qty_prices"], $qty);
// price factor
$display_normal_price = zen_get_products_actual_price($pre_selected->fields["products_id"]);
$display_special_price = zen_get_products_special_price($pre_selected->fields["products_id"]);
$attributes_price_final += zen_get_attributes_price_factor($display_normal_price, $display_special_price, $pre_selected->fields["attributes_price_factor"], $pre_selected->fields["attributes_price_factor_offset"]);
// per word and letter charges
if (zen_get_attributes_type($attribute) == PRODUCTS_OPTIONS_TYPE_TEXT) {
// calc per word or per letter
}
// onetime charges
if ($include_onetime == 'true') {
$pre_selected_onetime = $pre_selected;
$attributes_price_final += zen_get_attributes_price_final_onetime($pre_selected->fields["products_attributes_id"], 1, $pre_selected_onetime);
}
return $attributes_price_final;
}
开发者ID:jeking928,项目名称:Dual-Pricing-2.1.6,代码行数:54,代码来源:functions_prices.php
注:本文中的zen_get_attributes_price_final_onetime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论