本文整理汇总了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);
}
示例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));
}