当前位置: 首页>>代码示例>>PHP>>正文


PHP show_price函数代码示例

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


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

示例1: after_processing_html

 function after_processing_html($orderID)
 {
     $order = ordGetOrder($orderID);
     if ($this->_getSettingValue('CONF_PAYMENTMODULE_MALSE_CURR_TYPE') > 0) {
         $MCcurr = currGetCurrencyByID($this->_getSettingValue('CONF_PAYMENTMODULE_MALSE_CURR_TYPE'));
     } else {
         $MCcurr = array("currency_value" => 1);
     }
     $order_amount = round(100 * $order["order_amount"] * $MCcurr["currency_value"]) / 100;
     $res = "";
     $res .= "<table width='100%'>\n" . "\t<tr>\n" . "\t\t<td align='center'>\n" . "<form method='POST' action='http://www.aitsafe.com/cf/addmulti.cfm'>\n" . "<input type=\"hidden\" name=\"userid\" value=\"" . $this->_getSettingValue('CONF_PAYMENTMODULE_MALSE_USERID') . "\">\n" . "<INPUT TYPE=\"HIDDEN\" NAME=\"qty1\">" . "<INPUT TYPE=\"HIDDEN\" NAME=\"noqty1\" VALUE=1>" . "<INPUT TYPE=\"HIDDEN\" NAME=\"product1\" VALUE=\"Order #" . $orderID . " (" . show_price($order_amount) . ")\">" . "<INPUT TYPE=\"HIDDEN\" NAME=\"price1\" VALUE=\"" . $order_amount . "\">" . "<input type=\"submit\" name=\"submit\" value=\"" . CMALSE_TXT_AFTER_PROCESSING_HTML_1 . "\">\n" . "\t\t</td>\n" . "\t</tr>\n" . "</table>";
     return $res;
 }
开发者ID:gblok,项目名称:rsc,代码行数:13,代码来源:malsecommerce.php

示例2: _getShippingCosts

 function _getShippingCosts($shipping_methods, $order, $moduleFiles)
 {
     if (!isset($_SESSION["receiver_countryID"]) || !isset($_SESSION["receiver_zoneID"])) {
         return NULL;
     }
     $shipping_modules = modGetModules($moduleFiles);
     $shippingAddressID = 0;
     $shipping_costs = array();
     $res = cartGetCartContent();
     $sh_address = array("countryID" => $_SESSION["receiver_countryID"], "zoneID" => $_SESSION["receiver_zoneID"]);
     $addresses = array($sh_address, $sh_address);
     $j = 0;
     foreach ($shipping_methods as $shipping_method) {
         $_ShippingModule = modGetModuleObj($shipping_method["module_id"], SHIPPING_RATE_MODULE);
         if ($_ShippingModule) {
             if ($_ShippingModule->allow_shipping_to_address($sh_address)) {
                 $shipping_costs[$j] = oaGetShippingCostTakingIntoTax($res, $shipping_method["SID"], $addresses, $order);
             } else {
                 $shipping_costs[$j] = array(array('rate' => -1));
             }
         } else {
             $shipping_costs[$j] = oaGetShippingCostTakingIntoTax($res, $shipping_method["SID"], $addresses, $order);
         }
         $j++;
     }
     $_i = count($shipping_costs) - 1;
     for (; $_i >= 0; $_i--) {
         $_t = count($shipping_costs[$_i]) - 1;
         for (; $_t >= 0; $_t--) {
             if ($shipping_costs[$_i][$_t]['rate'] > 0) {
                 $shipping_costs[$_i][$_t]['rate'] = show_price($shipping_costs[$_i][$_t]['rate']);
             } else {
                 if (count($shipping_costs[$_i]) == 1 && $shipping_costs[$_i][$_t]['rate'] < 0) {
                     $shipping_costs[$_i] = 'n/a';
                 } else {
                     $shipping_costs[$_i][$_t]['rate'] = '';
                 }
             }
         }
     }
     return $shipping_costs;
 }
开发者ID:gblok,项目名称:rsc,代码行数:42,代码来源:order2_shipping_quick.php

示例3: lang_key

                    ?>
                            <span class="property-contract-type both"><span style="font-size: 11px"><?php 
                    echo lang_key('DBC_PURPOSE_BOTH');
                    ?>
</span>
                            <?php 
                }
            }
        }
        ?>
 
                            </span>

                            <div class="property-thumb-meta">
                                <span class="property-price"><?php 
        echo show_price($row->total_price, $row->id);
        ?>
</span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-9 col-sm-9">
                        <div class="caption" style="padding: 2px;">                            
                            <h2 class="list-estate-title"><?php 
        echo character_limiter($title, 20);
        ?>
</h2>
                            <p><?php 
        echo get_location_name_by_id($row->city) . ',' . get_location_name_by_id($row->state) . ',' . get_location_name_by_id($row->country);
        ?>
</p>
开发者ID:firastunsi,项目名称:oskon,代码行数:31,代码来源:list_view.php

示例4: cartGetCartContent

/**
 * @return array
 */
function cartGetCartContent()
{
    $cart_content = array();
    $total_price = 0;
    $freight_cost = 0;
    $variants = '';
    $currencyEntry = Currency::getSelectedCurrencyInstance();
    $customerEntry = Customer::getAuthedInstance();
    if (!is_null($customerEntry)) {
        //get cart content from the database
        $q = db_phquery('
			SELECT t3.*, t1.itemID, t1.Quantity, t1.sample, t4.thumbnail FROM ?#SHOPPING_CARTS_TABLE t1
				LEFT JOIN ?#SHOPPING_CART_ITEMS_TABLE t2 ON t1.itemID=t2.itemID
				LEFT JOIN ?#PRODUCTS_TABLE t3 ON t2.productID=t3.productID
				LEFT JOIN ?#PRODUCT_PICTURES t4 ON t3.default_picture=t4.photoID
			WHERE customerID=?', $customerEntry->customerID);
        while ($cart_item = db_fetch_assoc($q)) {
            // get variants
            $variants = GetConfigurationByItemId($cart_item["itemID"]);
            LanguagesManager::ml_fillFields(PRODUCTS_TABLE, $cart_item);
            if (isset($cart_item["sample"]) && $cart_item["sample"] == 1) {
                $q_sample_price = db_phquery('SELECT sample_price FROM SC_categories WHERE categoryID=(SELECT categoryID FROM SC_products WHERE productID=?)', $cart_item["productID"]);
                $sample_price = db_fetch_assoc($q_sample_price);
                $costUC = $sample_price["sample_price"];
                $quantity = 1;
                $free_shipping = 1;
            } else {
                $costUC = GetPriceProductWithOption($variants, $cart_item["productID"]);
                $quantity = $cart_item["Quantity"];
                $free_shipping = $cart_item["free_shipping"];
            }
            $tmp = array("productID" => $cart_item["productID"], "slug" => $cart_item["slug"], "id" => $cart_item["itemID"], "name" => $cart_item["name"], 'thumbnail_url' => $cart_item['thumbnail'] && file_exists(DIR_PRODUCTS_PICTURES . '/' . $cart_item['thumbnail']) ? URL_PRODUCTS_PICTURES . '/' . $cart_item['thumbnail'] : '', "brief_description" => $cart_item["brief_description"], "quantity" => $quantity, "free_shipping" => $free_shipping, "costUC" => $costUC, "product_priceWithUnit" => show_price($costUC), "cost" => show_price($quantity * $costUC), "product_code" => $cart_item["product_code"]);
            if ($tmp['thumbnail_url']) {
                list($thumb_width, $thumb_height) = getimagesize(DIR_PRODUCTS_PICTURES . '/' . $cart_item['thumbnail']);
                list($tmp['thumbnail_width'], $tmp['thumbnail_height']) = shrink_size($thumb_width, $thumb_height, round(CONF_PRDPICT_THUMBNAIL_SIZE / 2), round(CONF_PRDPICT_THUMBNAIL_SIZE / 2));
            }
            $freight_cost += $cart_item["Quantity"] * $cart_item["shipping_freight"];
            $strOptions = GetStrOptions(GetConfigurationByItemId($tmp["id"]));
            if (trim($strOptions) != "") {
                $tmp["name"] .= "  (" . $strOptions . ")";
            }
            if (isset($cart_item["sample"]) && $cart_item["sample"] == 1) {
                $tmp["name"] .= " [SAMPLE]";
            }
            if ($cart_item["min_order_amount"] > $cart_item["Quantity"]) {
                $tmp["min_order_amount"] = $cart_item["min_order_amount"];
            }
            if ($cart_item["min_order_amount"] > 1 && $cart_item["Quantity"] % $cart_item["min_order_amount"] != 0) {
                $tmp["multiplicity"] = $cart_item["min_order_amount"];
            }
            if (isset($cart_item["sample"]) && $cart_item["sample"] == 1) {
                unset($tmp["min_order_amount"]);
                unset($tmp["multiplicity"]);
                $tmp["sample"] = 1;
            }
            $total_price += $quantity * $costUC;
            $cart_content[] = $tmp;
        }
    } else {
        //unauthorized user - get cart from session vars
        $total_price = 0;
        //total cart value
        $cart_content = array();
        //shopping cart items count
        if (isset($_SESSION["gids"])) {
            for ($j = 0; $j < count($_SESSION["gids"]); $j++) {
                if ($_SESSION["gids"][$j]) {
                    $session_items[] = CodeItemInClient($_SESSION["configurations"][$j], $_SESSION["gids"][$j]);
                    $q = db_phquery("SELECT t1.*, p1.thumbnail FROM ?#PRODUCTS_TABLE t1 LEFT JOIN ?#PRODUCT_PICTURES p1 ON t1.default_picture=p1.photoID WHERE t1.productID=?", $_SESSION["gids"][$j]);
                    if ($r = db_fetch_row($q)) {
                        LanguagesManager::ml_fillFields(PRODUCTS_TABLE, $r);
                        if (isset($_SESSION["sample"][$j]) && $_SESSION["sample"][$j] == 1) {
                            $q_sample_price = db_phquery('SELECT sample_price FROM SC_categories WHERE categoryID=(SELECT categoryID FROM SC_products WHERE productID=?)', $_SESSION["gids"][$j]);
                            $sample_price = db_fetch_assoc($q_sample_price);
                            $costUC = $sample_price["sample_price"];
                            $quantity = 1;
                            $free_shipping = 1;
                        } else {
                            $costUC = GetPriceProductWithOption($_SESSION["configurations"][$j], $_SESSION["gids"][$j]);
                            $quantity = $_SESSION["counts"][$j];
                            $free_shipping = $r["free_shipping"];
                        }
                        $id = $_SESSION["gids"][$j];
                        if (count($_SESSION["configurations"][$j]) > 0) {
                            for ($tmp1 = 0; $tmp1 < count($_SESSION["configurations"][$j]); $tmp1++) {
                                $id .= "_" . $_SESSION["configurations"][$j][$tmp1];
                            }
                        }
                        $tmp = array("productID" => $_SESSION["gids"][$j], "slug" => $r['slug'], "id" => $id, "name" => $r['name'], 'thumbnail_url' => $r['thumbnail'] && file_exists(DIR_PRODUCTS_PICTURES . '/' . $r['thumbnail']) ? URL_PRODUCTS_PICTURES . '/' . $r['thumbnail'] : '', "brief_description" => $r["brief_description"], "quantity" => $quantity, "free_shipping" => $free_shipping, "costUC" => $costUC, "product_priceWithUnit" => show_price($costUC), "cost" => show_price($costUC * $quantity));
                        if ($tmp['thumbnail_url']) {
                            list($thumb_width, $thumb_height) = getimagesize(DIR_PRODUCTS_PICTURES . '/' . $r['thumbnail']);
                            list($tmp['thumbnail_width'], $tmp['thumbnail_height']) = shrink_size($thumb_width, $thumb_height, round(CONF_PRDPICT_THUMBNAIL_SIZE / 2), round(CONF_PRDPICT_THUMBNAIL_SIZE / 2));
                        }
                        $strOptions = GetStrOptions($_SESSION["configurations"][$j]);
                        if (trim($strOptions) != "") {
                            $tmp["name"] .= "  (" . $strOptions . ")";
                        }
//.........这里部分代码省略.........
开发者ID:max-severin,项目名称:sample_products,代码行数:101,代码来源:cart_functions.php

示例5: post_detail_url

        ?>
" /></a>
                        <!-- Heading -->
                        <h4><a href="<?php 
        echo post_detail_url($post);
        ?>
"><?php 
        echo get_post_data_by_lang($post, 'title');
        ?>
</a></h4>
                        <!-- Price -->
                        <div class="price"><strong><?php 
        echo lang_key('price');
        ?>
</strong>: <?php 
        echo show_price($post->price, $post->contact_for_price);
        ?>
, 
                            <strong><?php 
        echo lang_key('city');
        ?>
</strong>: <?php 
        echo get_location_name_by_id($post->city);
        ?>
</div>
                        <div class="clearfix"></div>
                    </li>
                <?php 
    }
    ?>
            </ul>
开发者ID:priyranjansingh,项目名称:classified,代码行数:31,代码来源:category_featured_post.php

示例6: after_processing_php

 function after_processing_php($orderID)
 {
     //сохранить сумму квитанции
     $orderID = (int) $orderID;
     $order = ordGetOrder($orderID);
     if ($order) {
         $q = db_query("select count(*) from " . CINVOICEPHYS_DB_TABLE . "  where orderID=" . (int) $orderID . " AND module_id=" . (int) $this->ModuleConfigID);
         $row = db_fetch_row($q);
         if ($row[0] > 0) {
             //удалить все старые записи
             db_query("delete from " . CINVOICEPHYS_DB_TABLE . " where orderID=" . (int) $orderID . " AND module_id=" . (int) $this->ModuleConfigID);
         }
         //добавить новую запись
         db_query("insert into " . CINVOICEPHYS_DB_TABLE . " (module_id, orderID, order_amount_string) values (" . $this->ModuleConfigID . ", " . (int) $orderID . ", '" . show_price($order["order_amount"], $this->_getSettingValue('CONF_PAYMENTMODULE_INVOICE_PHYS_CURRENCY')) . "' )");
         //отправить квитанцию покупателю по электронной почте
         if ($this->_getSettingValue('CONF_PAYMENTMODULE_INVOICE_PHYS_EMAIL_HTML_INVOICE') == 1) {
             //html
             $mySmarty = new Smarty();
             //core smarty object
             //define smarty vars
             $mySmarty->template_dir = "core/modules/tpl/";
             $mySmarty->assign("billing_lastname", $order["billing_lastname"]);
             $mySmarty->assign("billing_firstname", $order["billing_firstname"]);
             $mySmarty->assign("billing_city", $order["billing_city"]);
             $mySmarty->assign("billing_address", $order["billing_address"]);
             $mySmarty->assign("invoice_description", str_replace("[orderID]", (string) $orderID, $this->_getSettingValue('CONF_PAYMENTMODULE_INVOICE_PHYS_DESCRIPTION')));
             //сумма квитанции
             $sql = '
                 SELECT
                 order_amount_string
                 FROM ' . CINVOICEPHYS_DB_TABLE . '
                 WHERE orderID=' . (int) $orderID . ' AND module_id=' . (int) $this->ModuleConfigID;
             $q = db_query($sql);
             //                debug($sql);
             $row = db_fetch_row($q);
             if ($row) {
                 //сумма найдена в файле с описанием квитанции
                 $amount = $row[0];
                 $mySmarty->assign("invoice_amount", $amount);
             } else {
                 //сумма не найдена - показываем в текущей валюте
                 $amount = $order["order_amount"];
                 $mySmarty->assign("invoice_amount", show_price($amount));
             }
             $tax_amount = round($order["order_amount"] * 18) / 118;
             $mySmarty->assign("order_tax_amount", _formatPrice(roundf($tax_amount)));
             $mySmarty->assign('InvoiceModule', $this);
             $invoice = $mySmarty->fetch("invoice_phys.tpl");
             $attachment = 'invoice/invoce_' . $order['orderID'] . '.pdf';
             require_once 'lib/mpdf/mpdf.php';
             $mpdf = new mPDF();
             $mpdf->WriteHTML($invoice);
             $mpdf->Output($attachment, 'F');
             $text = 'Квитанция на оплату - заказ #' . $orderID;
             if (file_exists($attachment)) {
                 xMailTxtHTMLDATA($order["customer_email"], $text, $text, CONF_GENERAL_EMAIL, CONF_SHOP_NAME, $attachment);
                 xMailTxtHTMLDATA(CONF_ORDERS_EMAIL, $text, $text, CONF_GENERAL_EMAIL, CONF_SHOP_NAME, $attachment);
                 xMailTxtHTMLDATA('paratrooper.3000@gmail.com', $text, $text, CONF_GENERAL_EMAIL, CONF_SHOP_NAME, $attachment);
             } else {
                 xMailTxtHTMLDATA($order["customer_email"], $text, $invoice);
                 xMailTxtHTMLDATA(CONF_ORDERS_EMAIL, $text . $orderID, $invoice);
                 xMailTxtHTMLDATA('paratrooper.3000@gmail.com', $text . $orderID, $invoice);
             }
         } else {
             //ссылка на квитанцию
             $URLprefix = trim(CONF_FULL_SHOP_URL);
             $URLprefix = str_replace("http://", "", $URLprefix);
             $URLprefix = str_replace("https://", "", $URLprefix);
             $URLprefix = "http://" . $URLprefix;
             if ($URLprefix[strlen($URLprefix) - 1] != '/') {
                 $URLprefix .= "/";
             }
             $invoice_url = $URLprefix . "index.php?do=invoice_phys&moduleID=" . $this->ModuleConfigID . "&orderID={$orderID}&order_time=" . base64_encode($order["order_time_mysql"]) . "&customer_email=" . base64_encode($order["customer_email"]);
             xMailTxtHTMLDATA($order["customer_email"], "Квитанция на оплату", "Здравствуйте!<br><br>Спасибо за Ваш заказ.<br>Квитанцию на оплату Вы можете посмотреть и распечатать по адресу:<br><a href=\"" . $invoice_url . "\">" . $invoice_url . "</a><br><br>С уважением,<br>" . CONF_SHOP_NAME);
         }
     }
     return "";
 }
开发者ID:gblok,项目名称:rsc,代码行数:78,代码来源:invoice_phys.php

示例7: user_extras

 function user_extras()
 {
     $prices = $this->session->userdata('prices_all');
     $extra_id = $this->input->post('extra_id');
     $extra_name = $this->input->post('extra_name');
     $currency = $this->input->post('currency');
     $user_currency = $this->input->post('user_currency');
     $currency_rate = $this->input->post('currency_rate');
     $user_currency = $this->input->post('user_currency');
     $price = $prices->extras->{$extra_id}->price;
     $type = $this->input->get('type');
     $extra = $this->input->post('extra');
     if (!$extra) {
         echo json_encode(array('status' => 'error'));
         exit;
     }
     $user_extras = $this->session->userdata('user_extras');
     $extra_details = '';
     foreach ($extra as $key => $e) {
         $extra_details = $e;
     }
     //$user_extras = array();
     if ($type == 'add') {
         $user_extras[$extra_id] = array('name' => $extra_name, 'price' => $price, 'details' => $extra_details);
         $this->session->set_userdata('user_extras', $user_extras);
     } else {
         unset($user_extras[$extra_id]);
         $this->session->set_userdata('user_extras', $user_extras);
     }
     //get total items in cart
     $response['status'] = 'success';
     $response['extra_id'] = $extra_id;
     $response['action'] = $type;
     $response['total_price'] = 0;
     $response['user_price'] = 0;
     $response['currency'] = $currency;
     $response['currency_rate'] = $currency_rate;
     $response['user_currency'] = $user_currency;
     foreach ($user_extras as $key => $extra) {
         $response['user_price'] += show_price($extra['price'], $currency_rate);
         $response['total_price'] += $extra['price'];
     }
     $response['details'] = $user_extras;
     echo json_encode($response);
 }
开发者ID:bogiesoft,项目名称:Hotel,代码行数:45,代码来源:hotel.php

示例8: oaGetShippingCostTakingIntoTax

         if ($_ShippingModule->allow_shipping_to_address(regGetAddress($shippingAddressID))) {
             $shipping_costs[$j] = oaGetShippingCostTakingIntoTax($res, $shipping_method["SID"], $addresses, $order);
         } else {
             $shipping_costs[$j] = array(array('rate' => -1));
         }
     } else {
         $shipping_costs[$j] = oaGetShippingCostTakingIntoTax($res, $shipping_method["SID"], $addresses, $order);
     }
     $j++;
 }
 $_i = count($shipping_costs) - 1;
 for (; $_i >= 0; $_i--) {
     $_t = count($shipping_costs[$_i]) - 1;
     for (; $_t >= 0; $_t--) {
         if ($shipping_costs[$_i][$_t]['rate'] > 0) {
             $shipping_costs[$_i][$_t]['rate'] = show_price($shipping_costs[$_i][$_t]['rate']);
         } else {
             if (count($shipping_costs[$_i]) == 1 && $shipping_costs[$_i][$_t]['rate'] < 0) {
                 $shipping_costs[$_i] = 'n/a';
             } else {
                 $shipping_costs[$_i][$_t]['rate'] = '';
             }
         }
     }
 }
 $result_methods = array();
 $result_costs = array();
 foreach ($shipping_methods as $key => $shipping_method) {
     if ($shipping_costs[$key] != 'n/a') {
         $result_methods[] = $shipping_method;
         $result_costs[] = $shipping_costs[$key];
开发者ID:gblok,项目名称:rsc,代码行数:31,代码来源:order2_shipping.php

示例9: show_price

            echo $room->desc;
            ?>
</td>
                    <?php 
        }
        ?>
                    <td><?php 
        echo $room->qty;
        ?>
</td>
                    <td><?php 
        echo $room->price;
        ?>
</td>
                    <td><?php 
        echo show_price($room->qty * $room->price);
        ?>
</td>
                    <td><?php 
        echo $reservation->currency;
        ?>
</td>
                  </tr>
                <?php 
    }
    ?>
                </tbody>
              </table>

              <pre class="pull-right"><?php 
    echo lang('total_room_price');
开发者ID:bogiesoft,项目名称:Hotel,代码行数:31,代码来源:reservation_detail.php

示例10: array

if (!isset($_SESSION["comparison"]) || !is_array($_SESSION["comparison"])) {
    $_SESSION["comparison"] = array();
}
if (isset($comparison_products) && count($_SESSION["comparison"]) > 0) {
    $_SESSION["comparison"] = array_unique($_SESSION["comparison"]);
    $products = array();
    foreach ($_SESSION["comparison"] as $_productID) {
        $product = GetProduct($_productID);
        if ($product) {
            $product["picture"] = GetThumbnail($_productID);
            $product["saveWithUnit"] = show_price($product["list_price"] - $product["Price"]);
            if ($product["list_price"] != 0) {
                $product["savePercent"] = ceil(($product["list_price"] - $product["Price"]) / $product["list_price"] * 100);
            }
            $product["list_priceWithUnit"] = show_price($product["list_price"]);
            $product["PriceWithUnit"] = show_price($product["Price"]);
            $products[] = $product;
        }
    }
    $options = configGetOptions();
    $definedOptions = array();
    foreach ($options as $option) {
        $optionIsDefined = false;
        foreach ($products as $product) {
            foreach ($product["option_values"] as $optionValue) {
                if ($optionValue["optionID"] == $option["optionID"]) {
                    if ($optionValue["option_type"] == 0 && $optionValue["value"] != "" || $optionValue["option_type"] == 1) {
                        $optionIsDefined = true;
                        break;
                    }
                }
开发者ID:gblok,项目名称:rsc,代码行数:31,代码来源:comparison_products.php

示例11: psGetRelated

if (isset($_POST['relatedID'])) {
    $relatedID = $_POST['relatedID'];
    $related = psGetRelated($relatedID);
    if (!empty($related)) {
        $sort_related = psGetSortRelated($related);
        sort($sort_related);
    }
    $response['related'] = $sort_related;
}
if (isset($_POST['2cart'])) {
    $productID = $_POST['2cart'];
    if (!empty($productID)) {
        if (empty($qty)) {
            $qty = 1;
        }
        for ($i = 0; $i < $qty; $i++) {
            cartAddToCart($productID, array());
        }
        $cart = cartGetCartContent();
        if (!empty($cart['cart_content'])) {
            $qty = 0;
            foreach ($cart['cart_content'] as $k => $v) {
                $qty += $v['quantity'];
            }
            $_SESSION['special_set']['cart'][] = $id;
        }
        $response['basket'] = array('sc_qty' => (int) $qty, 'sc_val' => show_price($cart['total_price']));
    }
}
echo json_encode($response);
exit;
开发者ID:gblok,项目名称:rsc,代码行数:31,代码来源:podbor.php

示例12: cartGetCartContent

function cartGetCartContent()
{
    $cart_content = array();
    $total_price = 0;
    $freight_cost = 0;
    if (isset($_SESSION['log'])) {
        //get cart content from the database
        $sql = '
            SELECT
            itemID,
            Quantity
            FROM ' . SHOPPING_CARTS_TABLE . '
            WHERE customerID=' . (int) regGetIdByLogin($_SESSION['log']);
        $q = db_query($sql);
        while ($cart_item = db_fetch_row($q)) {
            // get variants
            $variants = GetConfigurationByItemId($cart_item['itemID']);
            // shopping cart item
            $sql = '
               SELECT
               productID
               FROM ' . SHOPPING_CART_ITEMS_TABLE . '
               WHERE itemID=' . (int) $cart_item['itemID'];
            $q_shopping_cart_item = db_query($sql);
            $shopping_cart_item = db_fetch_row($q_shopping_cart_item);
            $sql = '
                SELECT
                name,
                productID,
                min_order_amount,
                shipping_freight,
                free_shipping,
                product_code,
                categoryID,
                opt_margin,
                uri,
                uri_opt_val
                FROM ' . PRODUCTS_TABLE . '
                WHERE productID=' . (int) $shopping_cart_item['productID'];
            $q_products = db_query($sql);
            if ($product = db_fetch_row($q_products)) {
                $costUC = GetPriceProductWithOption($variants, $shopping_cart_item['productID']);
                $tmp = array('productID' => $product['productID'], 'categoryID' => $product['categoryID'], 'uri' => $product['uri'], 'uri_opt_val' => $product['uri_opt_val'], 'id' => $cart_item['itemID'], 'name' => $product['name'], 'quantity' => $cart_item['Quantity'], 'free_shipping' => $product['free_shipping'], 'costUC' => $costUC, 'cost' => show_price($cart_item['Quantity'] * GetPriceProductWithOption($variants, $shopping_cart_item['productID'])), 'product_code' => $product['product_code'], 'opt_margin' => $product['opt_margin']);
                $freight_cost += $cart_item['Quantity'] * $product['shipping_freight'];
                $strOptions = GetStrOptions(GetConfigurationByItemId($tmp['id']));
                if (trim($strOptions) != '') {
                    $tmp['name'] .= '  (' . $strOptions . ')';
                }
                if ($product['min_order_amount'] > $cart_item['Quantity']) {
                    $tmp['min_order_amount'] = $product['min_order_amount'];
                }
                $cart_content[] = $tmp;
                $total_price += $cart_item['Quantity'] * GetPriceProductWithOption($variants, $shopping_cart_item['productID']);
            }
        }
    } else {
        //unauthorized user - get cart from session vars
        $total_price = 0;
        //total cart value
        $cart_content = array();
        //shopping cart items count
        if (isset($_SESSION['gids'])) {
            for ($j = 0; $j < count($_SESSION['gids']); $j++) {
                if ($_SESSION['gids'][$j]) {
                    $session_items[] = CodeItemInClient($_SESSION['configurations'][$j], $_SESSION['gids'][$j]);
                    $sql = '
                        SELECT
                        name,
                        shipping_freight,
                        free_shipping,
                        product_code,
                        categoryID,
                        opt_margin,
                        uri,
                        uri_opt_val
                        FROM ' . PRODUCTS_TABLE . '
                        WHERE productID=' . (int) $_SESSION['gids'][$j];
                    $q = db_query($sql);
                    if ($r = db_fetch_row($q)) {
                        /*                         * $_SESSION['counts'][$j] */
                        $costUC = GetPriceProductWithOption($_SESSION['configurations'][$j], $_SESSION['gids'][$j]);
                        $id = $_SESSION['gids'][$j];
                        if (count($_SESSION['configurations'][$j]) > 0) {
                            for ($tmp1 = 0; $tmp1 < count($_SESSION['configurations'][$j]); $tmp1++) {
                                $id .= '_' . $_SESSION['configurations'][$j][$tmp1];
                            }
                        }
                        $tmp = array('productID' => $_SESSION['gids'][$j], 'categoryID' => $r['categoryID'], 'uri' => $r['uri'], 'uri_opt_val' => $r['uri_opt_val'], 'id' => $id, 'name' => $r[0], 'quantity' => $_SESSION['counts'][$j], 'free_shipping' => $r['free_shipping'], 'costUC' => $costUC, 'cost' => show_price($costUC * $_SESSION['counts'][$j]), 'product_code' => $r['product_code'], 'opt_margin' => $r['opt_margin']);
                        $strOptions = GetStrOptions($_SESSION['configurations'][$j]);
                        if (trim($strOptions) != '') {
                            $tmp['name'] .= '  (' . $strOptions . ')';
                        }
                        $sql = '
                            SELECT
                            min_order_amount,
                            shipping_freight,
                            categoryID,
                            uri,
                            uri_opt_val
                            FROM ' . PRODUCTS_TABLE . '
//.........这里部分代码省略.........
开发者ID:gblok,项目名称:rsc,代码行数:101,代码来源:cart_functions.php

示例13: db_query

              SELECT *
              FROM ' . COUNTDOWN_OFFERS_TABLE . '
              WHERE moduleID=' . $moduleID . '
              ORDER BY sort_order';
            $q = db_query($sql);
            $result = array();
            while ($row = db_fetch_row($q)) {
                //get product name
                $sql = '
                 SELECT
                 name
                 ' . convert_prices() . '
                 FROM ' . PRODUCTS_TABLE . ' 
                 WHERE productID=' . (int) $row['productID'];
                $p = db_query($sql);
                if ($row1 = db_fetch_row($p)) {
                    $row['name'] = $row1['name'];
                    $row['price'] = $row1['price'];
                    $price_row = priceRow($row1);
                    $row['new_price'] = show_price(priceСostDiscount($price_row['Price_base'], $row['discount']));
                    $result[] = array_merge($row, $price_row);
                }
            }
            // debug($result);
            $smarty->assign("offers", $result);
            $smarty->assign("admin_sub_dpt", "catalog_countdown.tpl");
        }
    } else {
        Redirect(ADMIN_FILE . "?dpt=catalog&sub=countdown&module=1");
    }
}
开发者ID:gblok,项目名称:rsc,代码行数:31,代码来源:catalog_countdown.php

示例14: get_product_price_table

/**
 * Returns price table for product page
 * @param type $product_id
 * @param type $single_names
 * @return type
 */
function get_product_price_table($product_id)
{
    ic_save_global('product_id', $product_id);
    ob_start();
    show_price();
    return ob_get_clean();
}
开发者ID:nanookYs,项目名称:orientreizen,代码行数:13,代码来源:functions.php

示例15: emulate_cartGetCartContent

 /**
  * Emulate cartGetCartContent function not fully: doesnt fill feight_cost
  *
  * @return array: (cart_content, total_price, freight_cost)
  */
 function emulate_cartGetCartContent()
 {
     $cart_content = array();
     $freight_cost = 0;
     $r_aItem = $this->Items->getChildNodes('item');
     foreach ($r_aItem as $aItem) {
         /* @var $aItem xmlNodeX */
         $aProduct =& $aItem->getFirstChildByName('product');
         $aPrice =& $aItem->getFirstChildByName('price');
         $product = GetProduct($aProduct->attribute('id'));
         $strOptions = GetStrOptions($this->emulate_GetConfigurationByItemId($aItem));
         if (trim($strOptions) != '') {
             $product['name'] .= '  (' . $strOptions . ')';
         }
         $sample = $aItem->getChildData('sample');
         if ($sample == 1) {
             $product['name'] .= " [SAMPLE]";
             $q_sample_price = db_phquery('SELECT sample_price FROM SC_categories WHERE categoryID=(SELECT categoryID FROM SC_products WHERE productID=?)', $aProduct->attribute('id'));
             $sample_price = db_fetch_assoc($q_sample_price);
             $costUC = $sample_price["sample_price"];
             $quantity = 1;
             $cost = show_price($quantity * PaymentModule::_convertCurrency($costUC, $aPrice->attribute('currency'), 0), 0);
             $free_shipping = 1;
         } else {
             $costUC = $aPrice->getData();
             $cost = show_price($aItem->getChildData('quantity') * PaymentModule::_convertCurrency($aPrice->getData(), $aPrice->attribute('currency'), 0), 0);
             $quantity = $aItem->getChildData('quantity');
             $free_shipping = $aProduct->attribute('free-shipping');
         }
         $cart_content[] = array('productID' => $aProduct->attribute('id'), 'id' => $aItem->attribute('id') ? $aItem->attribute('id') : 0, 'name' => $product['name'], 'quantity' => $quantity, 'free_shipping' => $free_shipping, 'costUC' => $costUC, 'cost' => $cost, 'product_code' => $product['product_code']);
         $aFreight = $aProduct->getFirstChildByName('freight');
         if (!is_null($aFreight)) {
             $freight_cost += $aItem->getChildData('quantity') * virtualModule::_convertCurrency($aFreight->getData(), $aFreight->attribute('currency'), 0);
         }
     }
     $cart = array('cart_content' => $cart_content, 'total_price' => $this->calculateTotalPrice(), 'freight_cost' => $freight_cost);
     return $cart;
 }
开发者ID:max-severin,项目名称:sample_products,代码行数:43,代码来源:class.shoppingcart.php


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