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


PHP JSFactory::getAllCurrency方法代码示例

本文整理汇总了PHP中JSFactory::getAllCurrency方法的典型用法代码示例。如果您正苦于以下问题:PHP JSFactory::getAllCurrency方法的具体用法?PHP JSFactory::getAllCurrency怎么用?PHP JSFactory::getAllCurrency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JSFactory的用法示例。


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

示例1: loadCurrencyValue

 function loadCurrencyValue()
 {
     $session = JFactory::getSession();
     $id_currency_session = $session->get('js_id_currency');
     $id_currency = JRequest::getInt('id_currency');
     $main_currency = $this->mainCurrency;
     if ($this->default_frontend_currency) {
         $main_currency = $this->default_frontend_currency;
     }
     if ($session->get('js_id_currency_orig') && $session->get('js_id_currency_orig') != $main_currency) {
         $id_currency_session = 0;
         $session->set('js_update_all_price', 1);
     }
     if (!$id_currency && $id_currency_session) {
         $id_currency = $id_currency_session;
     }
     $session->set('js_id_currency_orig', $main_currency);
     if ($id_currency) {
         $this->cur_currency = $id_currency;
     } else {
         $this->cur_currency = $main_currency;
     }
     $session->set('js_id_currency', $this->cur_currency);
     $all_currency = JSFactory::getAllCurrency();
     $current_currency = $all_currency[$this->cur_currency];
     if (!$current_currency->currency_value) {
         $current_currency->currency_value = 1;
     }
     $this->currency_value = $current_currency->currency_value;
     $this->currency_code = $current_currency->currency_code;
     $this->currency_code_iso = $current_currency->currency_code_iso;
 }
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:32,代码来源:config.php

示例2: getBuildQueryOrderListProduct

 function getBuildQueryOrderListProduct($order, $orderby, &$adv_from)
 {
     $order_query = "";
     if (!$order) {
         return $order_query;
     }
     $order_original = $order;
     $jshopConfig = JSFactory::getConfig();
     $multyCurrency = count(JSFactory::getAllCurrency());
     if ($multyCurrency > 1 && $order == "prod.product_price") {
         if (strpos($adv_from, "jshopping_currencies") === false) {
             $adv_from .= " LEFT JOIN `#__jshopping_currencies` AS cr USING (currency_id) ";
         }
         if ($jshopConfig->product_list_show_min_price) {
             $order = "prod.min_price/cr.currency_value";
         } else {
             $order = "prod.product_price/cr.currency_value";
         }
     }
     if ($order == "prod.product_price" && $jshopConfig->product_list_show_min_price) {
         $order = "prod.min_price";
     }
     $order_query = " ORDER BY " . $order;
     if ($orderby) {
         $order_query .= " " . $orderby;
     }
     JPluginHelper::importPlugin('jshoppingproducts');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBuildQueryOrderListProduct', array($order, $orderby, &$adv_from, &$order_query, $order_original));
     return $order_query;
 }
开发者ID:Tommar,项目名称:vino2,代码行数:31,代码来源:jtableauto.php

示例3: getPriceFromCurrency

function getPriceFromCurrency($price, $currency_id = 0, $current_currency_value = 0)
{
    $jshopConfig = JSFactory::getConfig();
    if ($currency_id) {
        $all_currency = JSFactory::getAllCurrency();
        $value = $all_currency[$currency_id]->currency_value;
        if (!$value) {
            $value = 1;
        }
        $pricemaincurrency = $price / $value;
    } else {
        $pricemaincurrency = $price;
    }
    if (!$current_currency_value) {
        $current_currency_value = $jshopConfig->currency_value;
    }
    return $pricemaincurrency * $current_currency_value;
}
开发者ID:JexyRu,项目名称:jshop-updates,代码行数:18,代码来源:functions.php

示例4: loadpaymentprice

 function loadpaymentprice($data_order, $products)
 {
     JModelLegacy::addIncludePath(JPATH_COMPONENT_SITE . '/models');
     $jshopConfig = JSFactory::getConfig();
     $jshopConfig->display_price_front_current = $data_order['display_price'];
     $all_currency = JSFactory::getAllCurrency();
     $currency_id = $data_order['currency_id'];
     if ($currency_id) {
         $jshopConfig->currency_value = $all_currency[$currency_id]->currency_value;
     }
     $id_country = $data_order['d_country'];
     if (!$id_country) {
         $id_country = $data_order['country'];
     }
     $AllTaxes = JSFactory::getAllTaxes();
     $paym_method = JSFactory::getTable('paymentmethod', 'jshop');
     $paym_method->load($data_order['payment_method_id']);
     if ($paym_method->price_type == 2) {
         $total = 0;
         foreach ($products as $key => $product) {
             $tax = floatval($product['product_tax']);
             $product_price = $product['product_item_price'] * $product['product_quantity'];
             if ($data_order['display_price']) {
                 $product_price = $product_price + $product_price * $tax / 100;
             }
             $total += $product_price;
         }
         $cproducts = $this->getCartProductsFromOrderProducts($products);
         $cart = JSFactory::getModel('cart', 'jshop');
         $cart->products = array();
         $cart->loadProductsFromArray($cproducts);
         $cart->loadPriceAndCountProducts();
         $shipping_method = JSFactory::getTable('shippingMethod', 'jshop');
         $sh_pr_method_id = $shipping_method->getShippingPriceId($data_order['shipping_method_id'], $id_country);
         $shipping_method_price = JSFactory::getTable('shippingMethodPrice', 'jshop');
         $shipping_method_price->load($sh_pr_method_id);
         $tax = floatval($AllTaxes[$shipping_method_price->shipping_tax_id]);
         $shipping_price = $data_order['order_shipping'];
         if ($data_order['display_price']) {
             $shipping_taxes = $shipping_method_price->calculateShippingTaxList($shipping_price, $cart);
             foreach ($shipping_taxes as $k => $v) {
                 $shipping_price = $shipping_price + $v;
             }
         }
         $total += $shipping_price;
         $tax = floatval($AllTaxes[$shipping_method_price->package_tax_id]);
         $package_price = $data_order['order_package'];
         if ($data_order['display_price']) {
             $shipping_taxes = $shipping_method_price->calculatePackageTaxList($package_price, $cart);
             foreach ($shipping_taxes as $k => $v) {
                 $package_price = $package_price + $v;
             }
         }
         $total += $package_price;
         $price = $total * $paym_method->price / 100;
         if ($data_order['display_price']) {
             $price = getPriceCalcParamsTax($price, $paym_method->tax_id, $cart->products);
         }
     } else {
         $price = $paym_method->price * $jshopConfig->currency_value;
         $price = getPriceCalcParamsTax($price, $paym_method->tax_id, $cart->products);
     }
     extract(js_add_trigger(get_defined_vars(), "before"));
     return $price;
 }
开发者ID:olegverstka,项目名称:monax.dev,代码行数:65,代码来源:orders.php


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