本文整理汇总了PHP中JSFactory::getAllTaxesOriginal方法的典型用法代码示例。如果您正苦于以下问题:PHP JSFactory::getAllTaxesOriginal方法的具体用法?PHP JSFactory::getAllTaxesOriginal怎么用?PHP JSFactory::getAllTaxesOriginal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSFactory
的用法示例。
在下文中一共展示了JSFactory::getAllTaxesOriginal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllTaxes
public static function getAllTaxes()
{
static $rows;
if (!is_array($rows)) {
$jshopConfig = JSFactory::getConfig();
$dispatcher = JDispatcher::getInstance();
$_tax = JSFactory::getTable('tax', 'jshop');
$rows = JSFactory::getAllTaxesOriginal();
if ($jshopConfig->use_extend_tax_rule) {
$country_id = 0;
$adv_user = JSFactory::getUserShop();
$country_id = $adv_user->country;
if ($jshopConfig->tax_on_delivery_address && $adv_user->delivery_adress && $adv_user->d_country) {
$country_id = $adv_user->d_country;
}
$client_type = $adv_user->client_type;
$enter_tax_id = $adv_user->tax_number != "";
if (!$country_id) {
$adv_user = JSFactory::getUserShopGuest();
$country_id = $adv_user->country;
if ($jshopConfig->tax_on_delivery_address && $adv_user->delivery_adress && $adv_user->d_country) {
$country_id = $adv_user->d_country;
}
$client_type = $adv_user->client_type;
$enter_tax_id = $adv_user->tax_number != "";
}
if ($country_id) {
$_rowsext = $_tax->getExtTaxes();
$dispatcher->trigger('beforeGetAllTaxesRowsext', array(&$_rowsext, &$country_id, &$adv_user, &$rows));
foreach ($_rowsext as $v) {
if (in_array($country_id, $v->countries)) {
if ($jshopConfig->ext_tax_rule_for == 1) {
if ($enter_tax_id) {
$rows[$v->tax_id] = $v->firma_tax;
} else {
$rows[$v->tax_id] = $v->tax;
}
} else {
if ($client_type == 2) {
$rows[$v->tax_id] = $v->firma_tax;
} else {
$rows[$v->tax_id] = $v->tax;
}
}
}
}
$dispatcher->trigger('afterGetAllTaxesRowsext', array(&$_rowsext, &$country_id, &$adv_user, &$rows));
unset($_rowsext);
}
}
$dispatcher->trigger('afterGetAllTaxes', array(&$rows));
}
return $rows;
}
示例2: getFixBrutopriceToTax
function getFixBrutopriceToTax($price, $tax_id)
{
$jshopConfig = JSFactory::getConfig();
if ($jshopConfig->no_fix_brutoprice_to_tax == 1) {
return $price;
}
$taxoriginal = JSFactory::getAllTaxesOriginal();
$taxes = JSFactory::getAllTaxes();
$tax = $taxes[$tax_id];
$tax2 = $taxoriginal[$tax_id];
if ($tax != $tax2) {
$price = $price / (1 + $tax2 / 100);
$price = $price * (1 + $tax / 100);
}
return $price;
}
示例3: getFixBrutopriceToTax
function getFixBrutopriceToTax($price, $tax_id)
{
$taxoriginal = JSFactory::getAllTaxesOriginal();
$taxes = JSFactory::getAllTaxes();
$tax = $taxes[$tax_id];
$tax2 = $taxoriginal[$tax_id];
if ($tax != $tax2) {
$price = $price / (1 + $tax2 / 100);
$price = $price * (1 + $tax / 100);
}
return $price;
}