本文整理汇总了PHP中zen_get_products_sale_discount_type函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_get_products_sale_discount_type函数的具体用法?PHP zen_get_products_sale_discount_type怎么用?PHP zen_get_products_sale_discount_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_get_products_sale_discount_type函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testGetSaleDiscountTypeInfo
/**
* Test getSaleDiscountTypeInfo.
*/
public function testGetSaleDiscountTypeInfo()
{
foreach ($this->get('productService')->getAllProducts(false, 1) as $product) {
$productId = $product->getId();
$info = $this->get('salemakerService')->getSaleDiscountTypeInfo($productId);
$er = error_reporting(0);
$type = zen_get_products_sale_discount_type($productId);
$amount = zen_get_products_sale_discount_type($productId, false, 'amount');
error_reporting($er);
if (!$this->assertEquals(array('type' => $type, 'amount' => $amount), $info)) {
echo $productId . $product->getName();
break;
}
}
}
开发者ID:zenmagick,项目名称:zenmagick,代码行数:18,代码来源:SalemakerServiceTest.php
示例2: LPAD
if ($pr_attr->fields['total'] > 0) {
if (PRODUCTS_OPTIONS_SORT_ORDER == '0') {
$options_order_by = ' order by LPAD(popt.products_options_sort_order,11,"0")';
} else {
$options_order_by = ' order by popt.products_options_name';
}
$sql = "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order,\r\n popt.products_options_type, popt.products_options_length, popt.products_options_comment,\r\n popt.products_options_size,\r\n popt.products_options_images_per_row,\r\n popt.products_options_images_style,\r\n popt.products_options_rows\r\n from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib\r\n where patrib.products_id='" . (int) $_GET['products_id'] . "'\r\n and patrib.options_id = popt.products_options_id\r\n and popt.language_id = '" . (int) $_SESSION['languages_id'] . "' " . $options_order_by;
$products_options_names = $db->Execute($sql);
// iii 030813 added: initialize $number_of_uploads
$number_of_uploads = 0;
if (PRODUCTS_OPTIONS_SORT_BY_PRICE == '1') {
$order_by = ' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name';
} else {
$order_by = ' order by LPAD(pa.products_options_sort_order,11,"0"), pa.options_values_price';
}
$discount_type = zen_get_products_sale_discount_type((int) $_GET['products_id']);
$discount_amount = zen_get_discount_calc((int) $_GET['products_id']);
$zv_display_select_option = 0;
while (!$products_options_names->EOF) {
$products_options_array = array();
/*
pa.options_values_price, pa.price_prefix,
pa.products_options_sort_order, pa.product_attribute_is_free, pa.products_attributes_weight, pa.products_attributes_weight_prefix,
pa.attributes_default, pa.attributes_discounted, pa.attributes_image
*/
$sql = "select pov.products_options_values_id,\r\n pov.products_options_values_name,\r\n pa.*\r\n from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov\r\n where pa.products_id = '" . (int) $_GET['products_id'] . "'\r\n and pa.options_id = '" . (int) $products_options_names->fields['products_options_id'] . "'\r\n and pa.options_values_id = pov.products_options_values_id\r\n and pov.language_id = '" . (int) $_SESSION['languages_id'] . "' " . $order_by;
$products_options = $db->Execute($sql);
$products_options_value_id = '';
$products_options_details = '';
$products_options_details_noname = '';
$tmp_radio = '';
开发者ID:dalinhuang,项目名称:kakayaga,代码行数:31,代码来源:attributes.php
示例3: zen_get_discount_calc
function zen_get_discount_calc($product_id, $attributes_id = false, $attributes_amount = false, $check_qty = false)
{
global $discount_type_id, $sale_maker_discount;
global $cart;
// no charge
if ($attributes_id > 0 and $attributes_amount == 0) {
return 0;
}
$new_products_price = zen_get_products_base_price($product_id);
$new_special_price = zen_get_products_special_price($product_id, true);
$new_sale_price = zen_get_products_special_price($product_id, false);
$discount_type_id = zen_get_products_sale_discount_type($product_id);
if ($new_products_price != 0) {
$special_price_discount = $new_special_price != 0 ? $new_special_price / $new_products_price : 1;
} else {
$special_price_discount = '';
}
$sale_maker_discount = zen_get_products_sale_discount_type($product_id, '', 'amount');
// percentage adjustment of discount
if ($discount_type_id == 120 or $discount_type_id == 1209 or ($discount_type_id == 110 or $discount_type_id == 1109)) {
$sale_maker_discount = $sale_maker_discount != 0 ? (100 - $sale_maker_discount) / 100 : 1;
}
$qty = $check_qty;
// fix here
// BOF: percentage discounts apply to price
switch (true) {
case zen_get_discount_qty($product_id, $qty) and !$attributes_id:
// discount quanties exist and this is not an attribute
// $this->contents[$products_id]['qty']
$check_discount_qty_price = zen_get_products_discount_price_qty($product_id, $qty, $attributes_amount);
//echo 'How much 1 ' . $qty . ' : ' . $attributes_amount . ' vs ' . $check_discount_qty_price . '<br />';
return $check_discount_qty_price;
break;
case zen_get_discount_qty($product_id, $qty) and zen_get_products_price_is_priced_by_attributes($product_id):
// discount quanties exist and this is not an attribute
// $this->contents[$products_id]['qty']
$check_discount_qty_price = zen_get_products_discount_price_qty($product_id, $qty, $attributes_amount);
//echo 'How much 2 ' . $qty . ' : ' . $attributes_amount . ' vs ' . $check_discount_qty_price . '<br />';
return $check_discount_qty_price;
break;
case $discount_type_id == 5:
// No Sale and No Special
// $sale_maker_discount = 1;
if (!$attributes_id) {
$sale_maker_discount = $sale_maker_discount;
} else {
// compute attribute amount
if ($attributes_amount != 0) {
if ($special_price_discount != 0) {
$calc = $attributes_amount * $special_price_discount;
} else {
$calc = $attributes_amount;
}
$sale_maker_discount = $calc;
} else {
$sale_maker_discount = $sale_maker_discount;
}
}
//echo 'How much 3 - ' . $qty . ' : ' . $product_id . ' : ' . $qty . ' x ' . $attributes_amount . ' vs ' . $check_discount_qty_price . ' - ' . $sale_maker_discount . '<br />';
break;
case $discount_type_id == 59:
// No Sale and Special
// $sale_maker_discount = $special_price_discount;
if (!$attributes_id) {
$sale_maker_discount = $sale_maker_discount;
} else {
// compute attribute amount
if ($attributes_amount != 0) {
$calc = $attributes_amount * $special_price_discount;
$sale_maker_discount = $calc;
} else {
$sale_maker_discount = $sale_maker_discount;
}
}
break;
// EOF: percentage discount apply to price
// BOF: percentage discounts apply to Sale
// EOF: percentage discount apply to price
// BOF: percentage discounts apply to Sale
case $discount_type_id == 120:
// percentage discount Sale and Special without a special
if (!$attributes_id) {
$sale_maker_discount = $sale_maker_discount;
} else {
// compute attribute amount
if ($attributes_amount != 0) {
$calc = $attributes_amount * $sale_maker_discount;
$sale_maker_discount = $calc;
} else {
$sale_maker_discount = $sale_maker_discount;
}
}
break;
case $discount_type_id == 1209:
// percentage discount on Sale and Special with a special
if (!$attributes_id) {
$sale_maker_discount = $sale_maker_discount;
} else {
// compute attribute amount
if ($attributes_amount != 0) {
//.........这里部分代码省略.........
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:101,代码来源:functions_prices.php
示例4: zen_get_products_base_price
<tr>
<td colspan="2" class="breadCrumb"><?php
echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR);
?>
</td>
</tr>
<tr>
<td colspan="2" class="smallText">
<?php
if (false) {
echo 'Looking at ' . (int) $_GET['products_id'] . '<br />';
echo 'Base Price ' . zen_get_products_base_price((int) $_GET['products_id']) . '<br />';
echo 'Actual Price ' . zen_get_products_actual_price((int) $_GET['products_id']) . '<br />';
echo 'Special Price ' . zen_get_products_special_price((int) $_GET['products_id'], true) . '<br />';
echo 'Sale Maker Discount Type ' . zen_get_products_sale_discount_type((int) $_GET['products_id']) . '<br />';
echo 'Discount Calc ' . zen_get_discount_calc((int) $_GET['products_id']) . '<br />';
echo 'Discount Calc Attr $100 $75 $50 $25 ' . zen_get_discount_calc((int) $_GET['products_id'], true, 100) . ' | ' . zen_get_discount_calc((int) $_GET['products_id'], true, 75) . ' | ' . zen_get_discount_calc((int) $_GET['products_id'], true, 50) . ' | ' . zen_get_discount_calc((int) $_GET['products_id'], true, 25) . '<br />';
}
?>
</td>
</tr>
<?php
if (PRODUCT_INFO_PREVIOUS_NEXT == '1' or PRODUCT_INFO_PREVIOUS_NEXT == '3') {
?>
<tr>
<td colspan="2" align="center">
<?php
require $template->get_template_dir('/tpl_products_next_previous.php', DIR_WS_TEMPLATE, $current_page_base, 'templates') . '/tpl_products_next_previous.php';
?>
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:tpl_product_info_display.php
注:本文中的zen_get_products_sale_discount_type函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论