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


PHP JSFactory::getAllUnits方法代码示例

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


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

示例1: getProductBasicPriceInfo

function getProductBasicPriceInfo($obj, $price)
{
    $jshopConfig = JSFactory::getConfig();
    $price_show = $obj->weight_volume_units != 0;
    if (!$jshopConfig->admin_show_product_basic_price || $price_show == 0) {
        return array("price_show" => 0);
    }
    $units = JSFactory::getAllUnits();
    $unit = $units[$obj->basic_price_unit_id];
    $basic_price = $price / $obj->weight_volume_units * $unit->qty;
    return array("price_show" => $price_show, "basic_price" => $basic_price, "name" => $unit->name, "unit_qty" => $unit->qty);
}
开发者ID:JexyRu,项目名称:jshop-updates,代码行数:12,代码来源:functions.php

示例2: getAddPrices

 function getAddPrices()
 {
     $jshopConfig = JSFactory::getConfig();
     $productprice = JSFactory::getTable('productprice', 'jshop');
     $this->product_add_prices = $productprice->getAddPrices($this->product_id);
     $price = $this->getPriceWithParams();
     $price_wp = $this->product_price;
     foreach ($this->product_add_prices as $k => $v) {
         if ($jshopConfig->product_price_qty_discount == 1) {
             $this->product_add_prices[$k]->price = $price - $v->discount;
             //discount value
             $this->product_add_prices[$k]->price_wp = $price_wp - $v->discount;
         } else {
             $this->product_add_prices[$k]->price = $price - $price * $v->discount / 100;
             //discount percent
             $this->product_add_prices[$k]->price_wp = $price_wp - $price_wp * $v->discount / 100;
         }
     }
     if (!$this->add_price_unit_id) {
         $this->add_price_unit_id = $jshopConfig->product_add_price_default_unit;
     }
     $units = JSFactory::getAllUnits();
     $unit = $units[$this->add_price_unit_id];
     $this->product_add_price_unit = $unit->name;
     if ($this->product_add_price_unit == "") {
         $this->product_add_price_unit = JSHP_ST_;
     }
     JDispatcher::getInstance()->trigger('onAfterGetAddPricesProduct', array(&$this));
 }
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:29,代码来源:product.php


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