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

PHP zen_get_products_price_is_priced_by_attributes函数代码示例

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

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



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

示例1: get_content_type

 /**
  * Method to calculate the content type of a cart
  *
  * @param boolean whether to test for Gift Vouchers only
  * @return string
  */
 function get_content_type($gv_only = 'false')
 {
     global $db;
     $this->content_type = false;
     $gift_voucher = 0;
     //      if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) {
     if ($this->count_contents() > 0) {
         reset($this->contents);
         while (list($products_id, ) = each($this->contents)) {
             $free_ship_check = $db->Execute("select products_virtual, products_model, products_price, product_is_always_free_shipping from " . TABLE_PRODUCTS . " where products_id = '" . zen_get_prid($products_id) . "'");
             $virtual_check = false;
             if (preg_match('/^GIFT/', addslashes($free_ship_check->fields['products_model']))) {
                 // @TODO - fix GIFT price in cart special/attribute
                 $gift_special = zen_get_products_special_price(zen_get_prid($products_id), true);
                 $gift_pba = zen_get_products_price_is_priced_by_attributes(zen_get_prid($products_id));
                 //echo '$products_id: ' . zen_get_prid($products_id) . ' price: ' . ($free_ship_check->fields['products_price'] + $this->attributes_price($products_id)) . ' vs special price: ' . $gift_special . ' qty: ' . $this->contents[$products_id]['qty'] . ' PBA: ' . ($gift_pba ? 'YES' : 'NO') . '<br>';
                 if (!$gift_pba && $gift_special != 0 && $gift_special != $free_ship_check->fields['products_price']) {
                     $gift_voucher += $gift_special * $this->contents[$products_id]['qty'];
                 } else {
                     $gift_voucher += ($free_ship_check->fields['products_price'] + $this->attributes_price($products_id)) * $this->contents[$products_id]['qty'];
                 }
             }
             // product_is_always_free_shipping = 2 is special requires shipping
             // Example: Product with download
             if (isset($this->contents[$products_id]['attributes']) and $free_ship_check->fields['product_is_always_free_shipping'] != 2) {
                 reset($this->contents[$products_id]['attributes']);
                 while (list(, $value) = each($this->contents[$products_id]['attributes'])) {
                     $virtual_check_query = "select count(*) as total\n                                      from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                      where pa.products_id = '" . (int) $products_id . "'\n                                      and pa.options_values_id = '" . (int) $value . "'\n                                      and pa.products_attributes_id = pad.products_attributes_id";
                     $virtual_check = $db->Execute($virtual_check_query);
                     if ($virtual_check->fields['total'] > 0) {
                         switch ($this->content_type) {
                             case 'physical':
                                 $this->content_type = 'mixed';
                                 if ($gv_only == 'true') {
                                     return $gift_voucher;
                                 } else {
                                     return $this->content_type;
                                 }
                                 break;
                             default:
                                 $this->content_type = 'virtual';
                                 break;
                         }
                     } else {
                         switch ($this->content_type) {
                             case 'virtual':
                                 if ($free_ship_check->fields['products_virtual'] == '1') {
                                     $this->content_type = 'virtual';
                                 } else {
                                     $this->content_type = 'mixed';
                                     if ($gv_only == 'true') {
                                         return $gift_voucher;
                                     } else {
                                         return $this->content_type;
                                     }
                                 }
                                 break;
                             case 'physical':
                                 if ($free_ship_check->fields['products_virtual'] == '1') {
                                     $this->content_type = 'mixed';
                                     if ($gv_only == 'true') {
                                         return $gift_voucher;
                                     } else {
                                         return $this->content_type;
                                     }
                                 } else {
                                     $this->content_type = 'physical';
                                 }
                                 break;
                             default:
                                 if ($free_ship_check->fields['products_virtual'] == '1') {
                                     $this->content_type = 'virtual';
                                 } else {
                                     $this->content_type = 'physical';
                                 }
                         }
                     }
                 }
             } else {
                 switch ($this->content_type) {
                     case 'virtual':
                         if ($free_ship_check->fields['products_virtual'] == '1') {
                             $this->content_type = 'virtual';
                         } else {
                             $this->content_type = 'mixed';
                             if ($gv_only == 'true') {
                                 return $gift_voucher;
                             } else {
                                 return $this->content_type;
                             }
                         }
                         break;
                     case 'physical':
                         if ($free_ship_check->fields['products_virtual'] == '1') {
//.........这里部分代码省略.........
开发者ID:jeking928,项目名称:Dual-Pricing-2.1.6,代码行数:101,代码来源:shopping_cart.php


示例2: zen_get_products_price_is_priced_by_attributes

        <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">

<?php 
        if ($_GET['products_filter'] != '') {
            ?>
          <tr>
            <td class="main" width="200" align="left" valign="top">&nbsp;</td>
            <td colspan="2" class="main"><?php 
            echo TEXT_PRODUCT_TO_VIEW;
            ?>
</td>
          </tr>
          <tr>
            <td class="main" width="200" align="center" valign="top">
<?php 
            $display_priced_by_attributes = zen_get_products_price_is_priced_by_attributes($_GET['products_filter']);
            echo $display_priced_by_attributes ? '<span class="alert">' . TEXT_PRICED_BY_ATTRIBUTES . '</span>' . '<br />' : '';
            echo zen_get_products_display_price($_GET['products_filter']) . '<br /><br />';
            echo zen_get_products_quantity_min_units_display($_GET['products_filter'], $include_break = true);
            ?>
            </td>
            <td class="attributes-even" align="center"><?php 
            echo zen_draw_products_pull_down('products_filter', 'size="10"', '', true, $_GET['products_filter'], true, true);
            ?>
</td>
            <td class="main" align="right" valign="top"><?php 
            echo zen_image_submit('button_display.gif', IMAGE_DISPLAY);
            ?>
</td>
          </tr>
        </table></td>
开发者ID:quangn92,项目名称:visualyou,代码行数:31,代码来源:attributes_controller.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: update_credit_account

 /**
  * queue or release newly-purchased GV's
  */
 function update_credit_account($i)
 {
     global $db, $order, $insert_id;
     // only act on newly-purchased gift certificates
     if (preg_match('/^GIFT/', addslashes($order->products[$i]['model']))) {
         // determine how much GV was purchased
         // check if GV was purchased on Special
         $gv_original_price = zen_products_lookup((int) $order->products[$i]['id'], 'products_price');
         // if prices differ assume Special ang get Special Price
         // Do not use this on GVs Priced by Attribute
         if (MODULE_ORDER_TOTAL_GV_SPECIAL == 'true' && ($gv_original_price != 0 && $gv_original_price != $order->products[$i]['final_price'] && !zen_get_products_price_is_priced_by_attributes((int) $order->products[$i]['id']))) {
             $gv_order_amount = $gv_original_price * $order->products[$i]['qty'];
         } else {
             $gv_order_amount = $order->products[$i]['final_price'] * $order->products[$i]['qty'];
         }
         // if tax is to be calculated on purchased GVs, calculate it
         if ($this->credit_tax == 'true') {
             $gv_order_amount = $gv_order_amount * (100 + $order->products[$i]['tax']) / 100;
         }
         $gv_order_amount = $gv_order_amount * 100 / 100;
         if (MODULE_ORDER_TOTAL_GV_QUEUE == 'false') {
             // GV_QUEUE is false so release amount to account immediately
             $gv_result = $this->user_has_gv_account($_SESSION['customer_id']);
             $customer_gv = false;
             $total_gv_amount = 0;
             if ($gv_result) {
                 $total_gv_amount = $gv_result;
                 $customer_gv = true;
             }
             $total_gv_amount = $total_gv_amount + $gv_order_amount;
             if ($customer_gv) {
                 $db->Execute("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $total_gv_amount . "' where customer_id = '" . (int) $_SESSION['customer_id'] . "'");
             } else {
                 $db->Execute("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . (int) $_SESSION['customer_id'] . "', '" . $total_gv_amount . "')");
             }
         } else {
             // GV_QUEUE is true - so queue the gv for release by store owner
             $db->Execute("insert into " . TABLE_COUPON_GV_QUEUE . " (customer_id, order_id, amount, date_created, ipaddr) values ('" . (int) $_SESSION['customer_id'] . "', '" . (int) $insert_id . "', '" . $gv_order_amount . "', NOW(), '" . $_SERVER['REMOTE_ADDR'] . "')");
         }
     }
 }
开发者ID:promoweb,项目名称:zc-v1-series,代码行数:44,代码来源:ot_gv.php


示例5: zen_get_products_price_is_priced_by_attributes

            <tr>
              <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;
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:categories_quantity_discounts.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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