• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP zen_get_products_base_price函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中zen_get_products_base_price函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_get_products_base_price函数的具体用法?PHP zen_get_products_base_price怎么用?PHP zen_get_products_base_price使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了zen_get_products_base_price函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: testBasePrice

 /**
  * Test product base price.
  */
 public function testBasePrice()
 {
     foreach ($this->get('productService')->getAllProducts(false, 1) as $product) {
         $offers = $product->getOffers();
         // without tax
         $this->assertEquals(zen_get_products_base_price($product->getId()), $offers->getBasePrice(false), '%s productId=' . $product->getId());
     }
 }
开发者ID:zenmagick,项目名称:zenmagick,代码行数:11,代码来源:ProductPricingTest.php


示例2: eo_get_product_attribute_prices

function eo_get_product_attribute_prices($attr_id, $attr_value = '', $qty = 1)
{
    global $db;
    $retval = array('onetime_charges' => 0, 'price' => 0);
    $attribute_price = $db->Execute('SELECT * ' . 'FROM `' . TABLE_PRODUCTS_ATTRIBUTES . '` ' . 'WHERE `products_attributes_id`=\'' . (int) $attr_id . '\'');
    $attr_id = (int) $attr_id;
    $qty = (int) $qty;
    $product_id = (int) $attribute_price->fields['products_id'];
    // Only check when attributes is not free or the product is not free
    if ($attribute_price->fields['product_attribute_is_free'] != '1' || !zen_get_products_price_is_free($product_id)) {
        // Handle based upon discount enabled
        if ($attribute_price->fields['attributes_discounted'] == '1') {
            // Calculate proper discount for attributes
            $added_charge = zen_get_discount_calc($product_id, $attr_id, $attribute_price->fields['options_values_price'], $qty);
        } else {
            $added_charge = $attribute_price->fields['options_values_price'];
        }
        // Handle negative price prefix
        // Other price prefixes ("+" and "") should add so no special processing
        if ($attribute_price->fields['price_prefix'] == '-') {
            $added_charge = -1 * $added_charge;
        }
        $retval['price'] += $added_charge;
        //////////////////////////////////////////////////
        // calculate additional charges
        // products_options_value_text
        if (zen_get_attributes_type($attr_id) == PRODUCTS_OPTIONS_TYPE_TEXT) {
            $text_words = zen_get_word_count_price($attr_value, $attribute_price->fields['attributes_price_words_free'], $attribute_price->fields['attributes_price_words']);
            $text_letters = zen_get_letters_count_price($attr_value, $attribute_price->fields['attributes_price_letters_free'], $attribute_price->fields['attributes_price_letters']);
            $retval['price'] += $text_letters;
            $retval['price'] += $text_words;
        }
        // attributes_price_factor
        $added_charge = 0;
        if ($attribute_price->fields['attributes_price_factor'] > 0) {
            $chk_price = zen_get_products_base_price($products_id);
            $chk_special = zen_get_products_special_price($products_id, false);
            $added_charge = zen_get_attributes_price_factor($chk_price, $chk_special, $attribute_price->fields['attributes_price_factor'], $attribute_price->fields['attributes_price_factor_offset']);
            $retval['price'] += $added_charge;
        }
        // attributes_qty_prices
        $added_charge = 0;
        if ($attribute_price->fields['attributes_qty_prices'] != '') {
            $chk_price = zen_get_products_base_price($products_id);
            $chk_special = zen_get_products_special_price($products_id, false);
            $added_charge = zen_get_attributes_qty_prices_onetime($attribute_price->fields['attributes_qty_prices'], $qty);
            $retval['price'] += $added_charge;
        }
        // attributes_price_onetime
        if ($attribute_price->fields['attributes_price_onetime'] > 0) {
            $retval['onetime_charges'] = (double) $attribute_price->fields['attributes_price_onetime'];
        }
        // attributes_price_factor_onetime
        $added_charge = 0;
        if ($attribute_price->fields['attributes_price_factor_onetime'] > 0) {
            $chk_price = zen_get_products_base_price($products_id);
            $chk_special = zen_get_products_special_price($products_id, false);
            $added_charge = zen_get_attributes_price_factor($chk_price, $chk_special, $attribute_price->fields['attributes_price_factor_onetime'], $attribute_price->fields['attributes_price_factor_onetime_offset']);
            $retval['onetime_charges'] += $added_charge;
        }
        // attributes_qty_prices_onetime
        $added_charge = 0;
        if ($attribute_price->fields['attributes_qty_prices_onetime'] != '') {
            $chk_price = zen_get_products_base_price($products_id);
            $chk_special = zen_get_products_special_price($products_id, false);
            $added_charge = zen_get_attributes_qty_prices_onetime($attribute_price->fields['attributes_qty_prices_onetime'], $qty);
            $retval['onetime_charges'] += $added_charge;
        }
        ////////////////////////////////////////////////
    }
    return $retval;
}
开发者ID:bislewl,项目名称:super_edit_orders_with_ty,代码行数:72,代码来源:edit_orders_functions.php


示例3: zen_draw_products_pull_down_attributes

function zen_draw_products_pull_down_attributes($name, $parameters = '', $exclude = '')
{
    global $db, $currencies;
    if ($exclude == '') {
        $exclude = array();
    }
    $select_string = '<select name="' . $name . '"';
    if ($parameters) {
        $select_string .= ' ' . $parameters;
    }
    $select_string .= '>';
    $new_fields = ', p.products_model';
    $products = $db->Execute("select distinct p.products_id, pd.products_name, p.products_price" . $new_fields . "\r\n                              from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_ATTRIBUTES . " pa " . "\r\n                              where p.products_id= pa.products_id and p.products_id = pd.products_id\r\n                              and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\r\n                              order by products_name");
    while (!$products->EOF) {
        if (!in_array($products->fields['products_id'], $exclude)) {
            $display_price = zen_get_products_base_price($products->fields['products_id']);
            $select_string .= '<option value="' . $products->fields['products_id'] . '">' . $products->fields['products_name'] . ' (' . TEXT_MODEL . ' ' . $products->fields['products_model'] . ') (' . $currencies->format($display_price) . ')</option>';
        }
        $products->MoveNext();
    }
    $select_string .= '</select>';
    return $select_string;
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:23,代码来源:functions_categories.php


示例4: zen_draw_products_pull_down_attributes

function zen_draw_products_pull_down_attributes($name, $parameters = '', $exclude = '')
{
    global $gBitDb, $currencies;
    if ($exclude == '') {
        $exclude = array();
    }
    $select_string = '<select class="form-control" name="' . $name . '"';
    if ($parameters) {
        $select_string .= ' ' . $parameters;
    }
    $select_string .= '>';
    $new_fields = ', p.`products_model`';
    $products = $gBitDb->query("select distinct pom.`products_id`, pd.`products_name`, p.`products_price`" . $new_fields . "\n                              FROM " . TABLE_PRODUCTS . " p \n                                INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON(p.`products_id` = pd.`products_id`) \n\t\t\t\t\t\t\t\tINNER JOIN " . TABLE_PRODUCTS_OPTIONS_MAP . " pom ON(p.`products_id`= pom.`products_id`)\n                                INNER JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON(pa.`products_options_values_id`=pom.`products_options_values_id`)\n                              WHERE pd.`language_id` = ?\n                              ORDER BY `products_name`", array((int) $_SESSION['languages_id']));
    while (!$products->EOF) {
        if (!in_array($products->fields['products_id'], $exclude)) {
            $display_price = zen_get_products_base_price($products->fields['products_id']);
            $select_string .= '<option value="' . $products->fields['products_id'] . '">' . $products->fields['products_name'] . ' (' . TEXT_MODEL . ' ' . $products->fields['products_model'] . ') (' . $currencies->format($display_price) . ')</option>';
        }
        $products->MoveNext();
    }
    $select_string .= '</select>';
    return $select_string;
}
开发者ID:bitweaver,项目名称:commerce,代码行数:23,代码来源:functions_categories.php


示例5: zen_get_products_discount_price_qty

function zen_get_products_discount_price_qty($product_id, $check_qty, $check_amount = 0)
{
    global $db, $cart;
    $new_qty = $_SESSION['cart']->in_cart_mixed_discount_quantity($product_id);
    // check for discount qty mix
    if ($new_qty > $check_qty) {
        $check_qty = $new_qty;
    }
    $product_id = (int) $product_id;
    $products_query = $db->Execute("select products_discount_type, products_discount_type_from, products_priced_by_attribute from " . TABLE_PRODUCTS . " where products_id='" . $product_id . "'");
    $products_discounts_query = $db->Execute("select * from " . TABLE_PRODUCTS_DISCOUNT_QUANTITY . " where products_id='" . $product_id . "' and discount_qty <='" . $check_qty . "' order by discount_qty desc");
    $display_price = zen_get_products_base_price($product_id);
    $display_specials_price = zen_get_products_special_price($product_id, true);
    switch ($products_query->fields['products_discount_type']) {
        // none
        case $products_discounts_query->EOF:
            //no discount applies
            $discounted_price = zen_get_products_actual_price($product_id);
            break;
        case '0':
            $discounted_price = zen_get_products_actual_price($product_id);
            break;
            // percentage discount
        // percentage discount
        case '1':
            if ($products_query->fields['products_discount_type_from'] == '0') {
                // priced by attributes
                if ($check_amount != 0) {
                    $discounted_price = $check_amount - $check_amount * ($products_discounts_query->fields['discount_price'] / 100);
                    //echo 'ID#' . $product_id . ' Amount is: ' . $check_amount . ' discount: ' . $discounted_price . '<br />';
                    //echo 'I SEE 2 for ' . $products_query->fields['products_discount_type'] . ' - ' . $products_query->fields['products_discount_type_from'] . ' - '. $check_amount . ' new: ' . $discounted_price . ' qty: ' . $check_qty;
                } else {
                    $discounted_price = $display_price - $display_price * ($products_discounts_query->fields['discount_price'] / 100);
                }
            } else {
                if (!$display_specials_price) {
                    // priced by attributes
                    if ($check_amount != 0) {
                        $discounted_price = $check_amount - $check_amount * ($products_discounts_query->fields['discount_price'] / 100);
                    } else {
                        $discounted_price = $display_price - $display_price * ($products_discounts_query->fields['discount_price'] / 100);
                    }
                } else {
                    $discounted_price = $display_specials_price - $display_specials_price * ($products_discounts_query->fields['discount_price'] / 100);
                }
            }
            break;
            // actual price
        // actual price
        case '2':
            if ($products_query->fields['products_discount_type_from'] == '0') {
                $discounted_price = $products_discounts_query->fields['discount_price'];
            } else {
                $discounted_price = $products_discounts_query->fields['discount_price'];
            }
            break;
            // amount offprice
        // amount offprice
        case '3':
            if ($products_query->fields['products_discount_type_from'] == '0') {
                $discounted_price = $display_price - $products_discounts_query->fields['discount_price'];
            } else {
                if (!$display_specials_price) {
                    $discounted_price = $display_price - $products_discounts_query->fields['discount_price'];
                } else {
                    $discounted_price = $display_specials_price - $products_discounts_query->fields['discount_price'];
                }
            }
            break;
    }
    return $discounted_price;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:72,代码来源:functions_prices.php


示例6: array

     $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
     $contents[] = array('text' => '<br><b>' . $sInfo->products_name . '</b>');
     $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . zen_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'pre_add':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_PRE_ADD_SPECIALS . '</b>');
     $contents = array('form' => zen_draw_form('specials', FILENAME_SPECIALS, 'action=pre_add_confirmation'));
     $contents[] = array('text' => TEXT_INFO_PRE_ADD_INTRO);
     $contents[] = array('text' => '<br />' . TEXT_PRE_ADD_PRODUCTS_ID . '<br>' . zen_draw_input_field('pre_add_products_id', '', zen_set_field_length(TABLE_SPECIALS, 'products_id')));
     $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_confirm.gif', IMAGE_CONFIRM) . '&nbsp;<a href="' . zen_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 default:
     if (is_object($sInfo)) {
         $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');
         if ($sInfo->products_priced_by_attribute == '1') {
             $specials_current_price = zen_get_products_base_price($sInfo->products_id);
         } else {
             $specials_current_price = $sInfo->products_price;
         }
         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'action=edit&products_filter=' . $sInfo->products_id) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '</a>');
         $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($sInfo->specials_date_added));
         $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($sInfo->specials_last_modified));
         $contents[] = array('align' => 'center', 'text' => '<br>' . zen_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
         $contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($specials_current_price));
         $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price));
         $contents[] = array('text' => '' . TEXT_INFO_DISPLAY_PRICE . ' ' . zen_get_products_display_price($sInfo->products_id));
         $contents[] = array('text' => '<br>' . TEXT_INFO_AVAILABLE_DATE . ' <b>' . (($specials->fields['specials_date_available'] != '0001-01-01' and $specials->fields['specials_date_available'] != '') ? zen_date_short($specials->fields['specials_date_available']) : TEXT_NONE) . '</b>');
         $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . (($specials->fields['expires_date'] != '0001-01-01' and $specials->fields['expires_date'] != '') ? zen_date_short($specials->fields['expires_date']) : TEXT_NONE) . '</b>');
         $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . zen_date_short($sInfo->date_status_change));
         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CATEGORIES, '&action=new_product' . '&cPath=' . zen_get_product_path($sInfo->products_id, 'override') . '&pID=' . $sInfo->products_id . '&product_type=' . zen_get_products_type($sInfo->products_id)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '<br />' . TEXT_PRODUCT_EDIT . '</a>');
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:31,代码来源:specials.php


示例7: array

$lc_align = '';
$list_box_contents = array();
//echo $listing_split->sql_query;
//print_r(explode(' ',zen_products_id_in_category($current_category_id)));
if (zen_count_products_in_category($current_category_id) > 0) {
    $listing = $db->Execute($listing_split->sql_query);
    $row = 0;
    while (!$listing->EOF) {
        if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
            $list_box_contents[$row]['products_image'] = '';
        } else {
            $list_box_contents[$row]['products_image'] = $listing->fields['products_image'];
        }
        $list_box_contents[$row]['products_name'] = $listing->fields['products_name'];
        $list_box_contents[$row]['products_description'] = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), 100);
        $list_box_contents[$row]['products_price'] = zen_get_products_base_price($listing->fields['products_id']);
        $list_box_contents[$row]['actual_price'] = $currencies->display_price(zen_get_products_actual_price($listing->fields['products_id']), zen_get_tax_rate($product_check->fields['products_tax_class_id']));
        $list_box_contents[$row]['products_status'] = $listing->fields['products_status'];
        if ($listing->fields['product_is_always_free_shipping'] == 0) {
            $list_box_contents[$row]['product_is_always_free_shipping'] = '';
        } else {
            $list_box_contents[$row]['product_is_always_free_shipping'] = '<span class="free_shipping"></span>';
        }
        if ($listing->fields['product_is_free'] == 0) {
            $list_box_contents[$row]['product_is_free'] = '';
        } else {
            $list_box_contents[$row]['product_is_free'] = '<span class="free"></span>';
        }
        $list_box_contents[$row]['products_quantity_order_min'] = $listing->fields['products_quantity_order_min'];
        $list_box_contents[$row]['products_id'] = $listing->fields['products_id'];
        $list_box_contents[$row]['products_quantity'] = $listing->fields['products_quantity'];
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:product_listing.php


示例8: attributes_price_onetime_charges

 /**
  * Method to calculate one time price of attributes for a given item
  *
  * @param mixed the product ID of the item to check
  * @param decimal item quantity
  * @return decimal the pice of the items attributes
  */
 public function attributes_price_onetime_charges($products_id, $qty)
 {
     $attributes_price_onetime = 0;
     if (isset($this->contents[$products_id]['attributes'])) {
         reset($this->contents[$products_id]['attributes']);
         while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
             $attribute_price_query = "select *\n                    from %table.products_attributes%\n                    where products_id = '" . (int) $products_id . "'\n                    and options_id = '" . (int) $option . "'\n                    and options_values_id = '" . (int) $value . "'";
             $attribute_price = $this->getDb()->Execute($attribute_price_query);
             $new_attributes_price = 0;
             $discount_type_id = '';
             $sale_maker_discount = '';
             if ($attribute_price->fields['product_attribute_is_free'] == '1' and zen_get_products_price_is_free((int) $products_id)) {
                 // no charge
             } else {
                 $discount_type_id = '';
                 $sale_maker_discount = '';
                 $new_attributes_price = zen_get_discount_calc($products_id, $attribute_price->fields['products_attributes_id'], $attribute_price->fields['options_values_price'], $qty);
                 //////////////////////////////////////////////////
                 // calculate additional one time charges
                 //// one time charges
                 // attributes_price_onetime
                 if ($attribute_price->fields['attributes_price_onetime'] > 0) {
                     if ((int) $products_id != $products_id) {
                         die('I DO NOT MATCH ' . $products_id);
                     }
                     $attributes_price_onetime += $attribute_price->fields['attributes_price_onetime'];
                 }
                 // attributes_price_factor_onetime
                 $added_charge = 0;
                 if ($attribute_price->fields['attributes_price_factor_onetime'] > 0) {
                     $chk_price = zen_get_products_base_price($products_id);
                     $chk_special = zen_get_products_special_price($products_id, false);
                     $added_charge = zen_get_attributes_price_factor($chk_price, $chk_special, $attribute_price->fields['attributes_price_factor_onetime'], $attribute_price->fields['attributes_price_factor_onetime_offset']);
                     $attributes_price_onetime += $added_charge;
                 }
                 // attributes_qty_prices_onetime
                 $added_charge = 0;
                 if ($attribute_price->fields['attributes_qty_prices_onetime'] != '') {
                     $chk_price = zen_get_products_base_price($products_id);
                     $chk_special = zen_get_products_special_price($products_id, false);
                     $added_charge = zen_get_attributes_qty_prices_onetime($attribute_price->fields['attributes_qty_prices_onetime'], $qty);
                     $attributes_price_onetime += $added_charge;
                 }
             }
         }
     }
     return $attributes_price_onetime;
 }
开发者ID:zenmagick,项目名称:zenmagick,代码行数:55,代码来源:ShoppingCart.php


示例9: array

 $also_purchased_products = $db->Execute(sprintf(SQL_ALSO_PURCHASED, (int) $_GET['products_id'], (int) $_GET['products_id']));
 $num_products_ordered = $also_purchased_products->RecordCount();
 $row = 0;
 $col = 0;
 $list_box_contents = array();
 $title = '';
 // show only when 1 or more and equal to or greater than minimum set in admin
 if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED && $num_products_ordered > 0) {
     while (!$also_purchased_products->EOF) {
         //caizhouqing update by bof
         $rs = $db->Execute("select specials_new_products_price,products_id from specials where products_id=" . $also_purchased_products->fields['products_id']);
         $products_id = $rs->fields['products_id'];
         if ($products_id == $also_purchased_products->fields['products_id']) {
             $specials_price = $rs->fields['specials_new_products_price'];
         } else {
             $specials_price = zen_get_products_base_price($also_purchased_products->fields['products_id']);
         }
         //caizhouqing update by eof pro_show_right
         $also_purchased_products->fields['products_name'] = zen_get_products_name($also_purchased_products->fields['products_id']);
         $list_box_contents[$row][$col] = array('params' => 'class="top_selling"', 'text' => (($also_purchased_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<li><a href="' . zen_href_link(zen_get_info_page($also_purchased_products->fields['products_id']), 'products_id=' . $also_purchased_products->fields['products_id']) . '">' . zen_image_OLD(DIR_WS_IMAGES . $also_purchased_products->fields['products_image'], $also_purchased_products->fields['products_name'], '42', '42', ' class="fl"') . '</a>') . '<span><a href="' . zen_href_link(zen_get_info_page($also_purchased_products->fields['products_id']), 'products_id=' . $also_purchased_products->fields['products_id']) . '">' . substr($also_purchased_products->fields['products_name'], 0, 16) . '...' . '</a><br/><strong class="red">' . $currencies->display_price($specials_price, zen_get_tax_rate($products_tax_class_id)) . '</strong></span></li>');
         $col++;
         if ($col > SHOW_PRODUCT_INFO_COLUMNS_ALSO_PURCHASED_PRODUCTS - 1) {
             $col = 0;
             $row++;
         }
         $also_purchased_products->MoveNext();
     }
 }
 if ($also_purchased_products->RecordCount() > 0 && $also_purchased_products->RecordCount() >= MIN_DISPLAY_ALSO_PURCHASED) {
     $title = '<h4 class="line_120 margin_t">' . TEXT_ALSO_PURCHASED_PRODUCTS . '</h4>';
     $zc_show_also_purchased = true;
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:also_purchased_products.php


示例10: zen_get_products_quantity_order_min

var FRIENDLY_URLS='true';
var symbolLeft='<?php 
echo $currencies->display_symbol_left($_SESSION['currency']);
?>
';
var symbolRight='';
var min_quantity=<?php 
echo zen_get_products_quantity_order_min($_GET['products_id']);
?>
;
var discount = new Array();
discount[0] ="<?php 
echo zen_get_products_quantity_order_min($_GET['products_id']);
?>
-<?php 
echo number_format(zen_get_products_base_price($_GET['products_id']) == 0 ? zen_get_products_sample_price($_GET['products_id']) : zen_get_products_base_price($_GET['products_id']), 2);
?>
-0-0";
function formatC(s, flag){
if(flag == null){
flag =true;
 }
 s = s + '';
 if(/[^0-9\.]/.test(s)) return "invalid value";
 s=s.replace(/^(\d*)$/,"$1.");
 s=(s+"00").replace(/(\d*\.\d\d)\d*/,"$1");
 s=s.replace(".",",");
 var re=/(\d)(\d{3},)/;
 while(re.test(s)) s=s.replace(re,"$1,$2");
 s=s.replace(/,(\d\d)$/,".$1");
 if(flag){
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:jscript_main.php


示例11: zen_href_link

    echo zen_href_link(zen_get_info_page($flash_page_items[$i]['products_id']), 'products_id=' . $flash_page_items[$i]['products_id']);
    ?>
"><?php 
    echo zen_image_OLD(DIR_WS_IMAGES . $flash_page_items[$i]['products_image'], SEO_COMMON_KEYWORDS . ' ' . $flash_page_items[$i]['products_name'], 79, 79, 'id="cell_img' . $i . '" class="' . ($flash_page_items[$i]['products_id'] == $_GET['products_id'] ? 'imgborder' : '') . '"');
    ?>
</a><p><strong id="cell_price<?php 
    echo $i;
    ?>
" class="red"><?php 
    if (!empty($flash_page_items[$i]['specials_price'])) {
        //caizhouqing by bof
        $products_price = $products_price * ($flash_page_items[$i]['specials_price'] / $products_price);
        echo $list_box_contents[$row]['products_price'] == 0 ? $currencies->display_price($products_price, zen_get_tax_rate($products_tax_class_id)) : $currencies->display_price($products_price, zen_get_tax_rate($products_tax_class_id));
    } else {
        //caizhouqing by eof
        echo $currencies->display_price(zen_get_products_base_price($flash_page_items[$i]['products_id']) == 0 ? zen_get_products_sample_price($flash_page_items[$i]['products_id']) : zen_get_products_base_price($flash_page_items[$i]['products_id']), zen_get_tax_rate($product_check->fields['products_tax_class_id']));
    }
    ?>
</strong></p>
</li>
<?php 
    //print_r($flash_page_items[$i]);
}
?>
</ul>
</div>

<?php 
if (intval($flash_page->RecordCount()) > 1) {
    ?>
<script type="text/javascript">
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:tpl_product_flash_page.php


示例12: zen_get_products_discount_price_qty

function zen_get_products_discount_price_qty($product_id, $check_qty, $check_amount = 0)
{
    global $db, $cart;
    $new_qty = $_SESSION['cart']->in_cart_mixed_discount_quantity($product_id);
    // check for discount qty mix
    if ($new_qty > $check_qty) {
        $check_qty = $new_qty;
    }
    $product_id = (int) $product_id;
    $products_query = $db->Execute("select products_discount_type, products_discount_type_from, products_priced_by_attribute from " . TABLE_PRODUCTS . " where products_id='" . (int) $product_id . "'");
    $products_query_discount_type = $products_query->fields['products_discount_type'];
    $products_discounts_query = $db->Execute("select * from " . TABLE_PRODUCTS_DISCOUNT_QUANTITY . " where products_id='" . (int) $product_id . "' and discount_qty <='" . (double) $check_qty . "' order by discount_qty desc");
    if ($products_discounts_query->RecordCount() <= 0 and $products_query_discount_type == 0) {
        $products_query2 = $db->Execute("select categories_discount_type, categories_discount_type_from FROM " . TABLE_CATEGORIES . " c , " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where c.categories_id = pc.categories_id AND products_id='" . (int) $product_id . "'");
        $products_query_discount_type = $products_query2->fields['categories_discount_type'];
        $products_discounts_query = $db->Execute("SELECT * FROM " . TABLE_CATEGORIES_DISCOUNT_QUANTITY . " cd," . TABLE_PRODUCTS_TO_CATEGORIES . " pc WHERE cd.categories_id = pc.categories_id AND products_id = " . (int) $product_id . " AND discount_qty <= '" . (double) $check_qty . "' ORDER BY discount_qty DESC");
    }
    if (zen_get_products_base_price($product_id) == 0) {
        $display_price = zen_get_products_sample_price($product_id);
    } else {
        $display_price = zen_get_products_base_price($product_id);
    }
    $display_specials_price = zen_get_products_special_price($product_id, true);
    switch ($products_query_discount_type) {
        // none
        case $products_discounts_query->EOF:
            //no discount applies
            $discounted_price = zen_get_products_actual_price($product_id);
            break;
        case '0':
            $discounted_price = zen_get_products_actual_price($product_id);
            break;
            // percentage discount
        // percentage discount
        case '1':
            if ($products_query->fields['products_discount_type_from'] == '0') {
                // priced by attributes
                if ($check_amount != 0) {
                    $discounted_price = $check_amount - $check_amount * ($products_discounts_query->fields['discount_price'] / 100);
                    //echo 'ID#' . $product_id . ' Amount is: ' . $check_amount . ' discount: ' . $discounted_price . '<br />';
                    //echo 'I SEE 2 for ' . $products_query->fields['products_discount_type'] . ' - ' . $products_query->fields['products_discount_type_from'] . ' - '. $check_amount . ' new: ' . $discounted_price . ' qty: ' . $check_qty;
                } else {
                    $discounted_price = $display_price - $display_price * ($products_discounts_query->fields['discount_price'] / 100);
                }
            } else {
                if (!$display_specials_price) {
                    // priced by attributes
                    if ($check_amount != 0) {
                        $discounted_price = $check_amount - $check_amount * ($products_discounts_query->fields['discount_price'] / 100);
                    } else {
                        $discounted_price = $display_price - $display_price * ($products_discounts_query->fields['discount_price'] / 100);
                    }
                } else {
                    $discounted_price = $display_specials_price - $display_specials_price * ($products_discounts_query->fields['discount_price'] / 100);
                }
            }
            break;
            // actual price
        // actual price
        case '2':
            if ($products_query->fields['products_discount_type_from'] == '0') {
                $discounted_price = $products_discounts_query->fields['discount_price'];
            } else {
                $discounted_price = $products_discounts_query->fields['discount_price'];
            }
            break;
            // amount offprice
        // amount offprice
        case '3':
            if ($products_query->fields['products_discount_type_from'] == '0') {
                $discounted_price = $display_price - $products_discounts_query->fields['discount_price'];
            } else {
                if (!$display_specials_price) {
                    $discounted_price = $display_price - $products_discounts_query->fields['discount_price'];
                } else {
                    $discounted_price = $display_specials_price - $products_discounts_query->fields['discount_price'];
                }
            }
            break;
    }
    return $discounted_price;
}
开发者ID:happyxlq,项目名称:lt_svn,代码行数:82,代码来源:functions_prices.php


示例13: zen_get_products_price_is_priced_by_attributes

              <td class="main" align="left"><?php 
    echo TEXT_PRODUCTS_DISCOUNT_QTY_TITLE;
    ?>
</td>
              <td class="main" align="left"><?php 
    echo TEXT_PRODUCTS_DISCOUNT_QTY;
    ?>
</td>
              <td class="main" align="left" style="border-right:0;"><?php 
    echo TEXT_PRODUCTS_DISCOUNT_PRICE;
    ?>
</td>
            </tr>
  <?php 
    $display_priced_by_attributes = zen_get_products_price_is_priced_by_attributes($category_id);
    $display_price = zen_get_products_base_price($category_id);
    $display_specials_price = zen_get_products_special_price($category_id, true);
    $discount_query = "SELECT discount_id,discount_qty,discount_price FROM " . TABLE_CATEGORIES_DISCOUNT_QUANTITY . " WHERE categories_id = " . $category_id;
    $discount = $db->Execute($discount_query);
    $i = 0;
    while (!$discount->EOF) {
        $i++;
        $discount_name[] = array('id' => $i, 'discount_qty' => $discount->fields['discount_qty'], 'discount_price' => $discount->fields['discount_price']);
        $discount->MoveNext();
    }
    for ($i = 0, $n = 6; $i < $n; $i++) {
        switch ($pInfo->products_discount_type) {
            // none
            case '0':
                $discounted_price = 0;
                break;
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:categories_quantity_discounts.php


示例14: GetPriceList

 /**
  * @author chenliujin <[email protected]>
  * @since 2016-09-29
  * TODO clear $db, $currencies
  */
 public static function GetPriceList($products_id)
 {
     global $db, $currencies;
     $price = new \stdClass();
     $product_check = $db->Execute("\n\t\t\tselect \n\t\t\t\tproducts_tax_class_id, \n\t\t\t\tproducts_price, \n\t\t\t\tproducts_priced_by_attribute, \n\t\t\t\tproduct_is_free, \n\t\t\t\tproduct_is_call, \n\t\t\t\tproducts_type \n\t\t\tfrom " . TABLE_PRODUCTS . " \n\t\t\twhere products_id = '" . (int) $products_id . "'" . " limit 1");
     // no prices on Document General
     if ($product_check->fields['products_type'] == 3) {
         return '';
     }
     $price->normal_price = zen_get_products_base_price($products_id);
     $price->special_price = zen_get_products_special_price($products_id, true);
     $price->sale_price = zen_get_products_special_price($products_id, false);
     if ($price->sale_price) {
         $price->sale_discount = $currencies->format($price->normal_price - $price->sale_price);
         $price->sale_discount .= '&nbsp;';
         $price->sale_discount .= '(' . number_format(100 - $price->sale_price / $price->normal_price * 100, SHOW_SALE_DISCOUNT_DECIMALS) . '%)';
     } else {
         $price->sale_discount = $currencies->format($price->normal_price - $price->special_price);
         $price->sale_discount .= '&nbsp;';
         $price->sale_discount .= '(' . number_format(100 - $price->special_price / $price->normal_price * 100, SHOW_SALE_DISCOUNT_DECIMALS) . '%)';
     }
     return $price;
 }
开发者ID:chenliujin,项目名称:PHP,代码行数:28,代码来源:products.php


示例15: splitPageResults

$free_shipping_query_raw2 = $db->bindVars($free_shipping_query_raw2, ':languageID', $_SESSION['languages_id'], 'integer');
$free_shipping_split2 = new splitPageResults($free_shipping_query_raw2, isset($_GET['pagesize']) ? $_GET['pagesize'] : 24);
//check to see if we are in normal mode ... not showcase, not maintenance, etc
$show_submit = zen_run_normal();
$free_shipping2 = $db->Execute($free_shipping_split2->sql_query);
if ($free_shipping2->RecordCount() > 0) {
    $row = 0;
    while (!$free_shipping2->EOF) {
        if ($free_shipping2->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
            $list_box_contents2[$row]['products_image'] = '';
        } else {
            $list_box_contents2[$row]['products_image'] = $free_shipping2->fields['products_image'];
        }
        $list_box_contents2[$row]['products_name'] = $free_shipping2->fields['products_name'];
        $list_box_contents2[$row]['products_description'] = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($free_shipping2->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION);
        $list_box_contents2[$row]['products_price'] = zen_get_products_base_price($free_shipping2->fields['products_id']);
        $list_box_contents2[$row]['actual_price'] = $currencies->display_price(zen_get_products_actual_price($free_shipping2->fields['products_id']), zen_get_tax_rate($product_check->fields['products_tax_class_id']));
        $list_box_contents2[$row]['products_status'] = $free_shipping2->fields['products_status'];
        if ($free_shipping2->fields['product_is_always_free_shipping'] == 0) {
            $list_box_contents2[$row]['product_is_always_free_shipping'] = '';
        } else {
            $list_box_contents2[$row]['product_is_always_free_shipping'] = '<span class="free_shipping"></span>';
        }
        $list_box_contents2[$row]['products_quantity_order_min'] = $free_shipping2->fields['products_quantity_order_min'];
        $list_box_contents2[$row]['products_id'] = $free_shipping2->fields['products_id'];
        $list_box_contents2[$row]['products_quantity'] = $free_shipping2->fields['products_quantity'];
        $list_box_contents2[$row]['products_price_retail'] = $currencies->display_price($free_shipping2->fields['products_price_retail'], zen_get_tax_rate($product_check->fields['products_tax_class_id']));
        $list_box_contents2[$row]['products_price_sample'] = $currencies->display_price($free_shipping2->fields['products_price_sample'], zen_get_tax_rate($product_check->fields['products_tax_class_id']));
        $list_box_contents2[$row]['product_is_wholesale'] = $free_shipping2->fields['product_is_wholesale'];
        $list_box_contents2[$row]['product_wholesale_min'] = $free_shipping2->fields['product_wholesale_min'];
        $free_shipping2->MoveNext();
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:header_php.php


示例16: zen_get_products_base_price

                   }
               }
               break;
               // actual price
           // actual price
           case '2':
               if ($pInfo->products_discount_type_from == '0') {
                   $discounted_price = $discount['discount_price'];
               } else {
                   $discounted_price = $discount['discount_price'];
               }
               break;
               // amount offprice
           // amount offprice
           case '3':
               $display_price = zen_get_products_base_price($_GET['products_id']);
               if ($pInfo->products_discount_type_from == '0') {
                   $discounted_price = $display_price - $discount['discount_price'];
               } else {
                   if (!$display_specials_price) {
                       $discounted_price = $display_price - $discount['discount_price'];
                   } else {
                       $discounted_price = $display_specials_price - $discount['discount_price'];
                   }
               }
               break;
       }
       ?>
 <tr>
   <td class="main"><?php 
       echo tra(TEXT_PRODUCTS_DISCOUNT);
开发者ID:bitweaver,项目名称:commerce,代码行数:31,代码来源:products_price_manager.php


示例17: zen_get_products_display_price_pure_green

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP zen_get_products_category_id函数代码示例发布时间:2022-05-23
下一篇:
PHP zen_get_products_allow_add_to_cart函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap