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

PHP zen_get_attributes_price_factor函数代码示例

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

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



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

示例1: 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
  * @global object access to the db object
  */
 function attributes_price_onetime_charges($products_id, $qty)
 {
     global $db;
     $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 = $db->Execute($attribute_price_query);
             // Dual Pricing start
             if ($_SESSION['customer_id']) {
                 $customers_id = $_SESSION['customer_id'];
                 $customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '{$customers_id}'");
                 if ($customer_check->fields['customers_whole'] != "0") {
                     $i = $customer_check->fields['customers_whole'];
                     $i--;
                     $options_value_price = (double) $attribute_price->fields['options_values_price_w'];
                 } else {
                     $options_value_price = $attribute_price->fields['options_values_price'];
                 }
             } else {
                 $options_value_price = $attribute_price->fields['options_values_price'];
             }
             // Dual Pricing end
             $new_attributes_price = 0;
             $discount_type_id = '';
             $sale_maker_discount = '';
             //          if ($attribute_price->fields['product_attribute_is_free']) {
             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:jeking928,项目名称:Dual-Pricing-2.1.6,代码行数:74,代码来源:shopping_cart.php


示例2: zen_get_attributes_price_final_onetime

function zen_get_attributes_price_final_onetime($attribute, $qty = 1, $pre_selected_onetime)
{
    global $db;
    global $cart;
    if ($pre_selected_onetime == '' or $attribute != $pre_selected_onetime->fields["products_attributes_id"]) {
        $pre_selected_onetime = $db->Execute("select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_attributes_id= '" . $attribute . "'");
    } else {
        // use existing select
    }
    // one time charges
    // onetime charge
    $attributes_price_final_onetime += $pre_selected_onetime->fields["attributes_price_onetime"];
    // price factor
    $display_normal_price = zen_get_products_actual_price($pre_selected_onetime->fields["products_id"]);
    $display_special_price = zen_get_products_special_price($pre_selected_onetime->fields["products_id"]);
    // price factor one time
    $attributes_price_final_onetime += zen_get_attributes_price_factor($display_normal_price, $display_special_price, $pre_selected_onetime->fields["attributes_price_factor_onetime"], $pre_selected_onetime->fields["attributes_price_factor_onetime_offset"]);
    // onetime charge qty price
    $attributes_price_final_onetime += zen_get_attributes_qty_prices_onetime($pre_selected_onetime->fields["attributes_qty_prices_onetime"], 1);
    return $attributes_price_final_onetime;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:21,代码来源:functions_prices.php


示例3: 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


示例4: 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


示例5: getOrderAttributePrice

 function getOrderAttributePrice($pAttributeHash, $pProductHash)
 {
     $ret = 0;
     // normal attributes price
     if ($pAttributeHash["price_prefix"] == '-') {
         $ret -= $pAttributeHash["options_values_price"];
     } else {
         $ret += $pAttributeHash["options_values_price"];
     }
     // qty discounts
     $ret += zen_get_attributes_qty_prices_onetime($pAttributeHash["attributes_qty_prices"], $pProductHash['products_quantity']);
     // price factor
     $display_normal_price = $pProductHash['price'];
     $ret += zen_get_attributes_price_factor($pProductHash['price'], $pProductHash['price'], $pAttributeHash["attributes_price_factor"], $pAttributeHash["attributes_pf_offset"]);
     // per word and letter charges
     if (zen_get_attributes_type($pAttributeHash['products_attributes_id']) == PRODUCTS_OPTIONS_TYPE_TEXT) {
         // calc per word or per letter
     }
     return $ret;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:20,代码来源:CommerceOrder.php


示例6: getAttributesPriceFinalOnetime

 function getAttributesPriceFinalOnetime($pOptionsValuesId, $pQuantity = 1)
 {
     global $gBitDb;
     $attributes_price_final_onetime = 0;
     if ($optionValue = $this->getOptionValue(NULL, $pOptionsValuesId)) {
         // one time charges
         // onetime charge
         $attributes_price_final_onetime = $optionValue["attributes_price_onetime"];
         // price factor
         $display_normal_price = $this->getBasePrice();
         $display_special_price = $this->getSpecialPrice();
         // price factor one time
         $attributes_price_final_onetime += zen_get_attributes_price_factor($display_normal_price, $display_special_price, $optionValue["attributes_pf_onetime"], $optionValue["attributes_pf_onetime_offset"]);
         // onetime charge qty price
         $attributes_price_final_onetime += zen_get_attributes_qty_prices_onetime($optionValue["attributes_qty_prices_onetime"], 1);
     }
     return $attributes_price_final_onetime;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:18,代码来源:CommerceProduct.php



注:本文中的zen_get_attributes_price_factor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP zen_get_attributes_price_final函数代码示例发布时间:2022-05-23
下一篇:
PHP zen_get_all_get_params函数代码示例发布时间: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