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


PHP producthelper::taxexempt_addtocart方法代码示例

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


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

示例1: modifyCalculation

 public function modifyCalculation($cart)
 {
     $producthelper = new producthelper();
     $calArr = $this->_carthelper->calculation($cart);
     $cart['product_subtotal'] = $calArr[1];
     $session = JFactory::getSession();
     $discount_amount = 0;
     $voucherDiscount = 0;
     $couponDiscount = 0;
     $discount_excl_vat = 0;
     $totaldiscount = 0;
     if (DISCOUNT_ENABLE == 1) {
         $discount_amount = $producthelper->getDiscountAmount($cart);
         if ($discount_amount > 0) {
             $cart = $this->_session->get('cart');
         }
     }
     $cart['cart_discount'] = $discount_amount;
     if (array_key_exists('voucher', $cart)) {
         $voucherDiscount = $this->_carthelper->calculateDiscount('voucher', $cart['voucher']);
     }
     $cart['voucher_discount'] = $voucherDiscount;
     if (array_key_exists('coupon', $cart)) {
         $couponDiscount = $this->_carthelper->calculateDiscount('coupon', $cart['coupon']);
     }
     $cart['coupon_discount'] = $couponDiscount;
     $codeDsicount = $voucherDiscount + $couponDiscount;
     $totaldiscount = $cart['cart_discount'] + $codeDsicount;
     $calArr = $this->_carthelper->calculation($cart);
     $tax = $calArr[5];
     $discountVAT = 0;
     $chktag = $producthelper->taxexempt_addtocart();
     if (VAT_RATE_AFTER_DISCOUNT && !APPLY_VAT_ON_DISCOUNT && !empty($chktag)) {
         if (isset($cart['discount_tax']) && !empty($cart['discount_tax'])) {
             $discountVAT = $cart['discount_tax'];
             $calArr[1] = $calArr[1] - $cart['discount_tax'];
             $tax = $tax - $discountVAT;
         } else {
             $vatData = $producthelper->getVatRates();
             if (isset($vatData->tax_rate) && !empty($vatData->tax_rate)) {
                 $productPriceExclVAT = $cart['product_subtotal_excl_vat'];
                 $productVAT = $cart['product_subtotal'] - $cart['product_subtotal_excl_vat'];
                 $avgVAT = ($productPriceExclVAT + $productVAT) / $productPriceExclVAT - 1;
                 $discountVAT = $avgVAT * $totaldiscount / (1 + $avgVAT);
             }
         }
     }
     $cart['total'] = $calArr[0] - $totaldiscount;
     $cart['subtotal'] = $calArr[1] + $calArr[3] - $totaldiscount;
     $cart['subtotal_excl_vat'] = $calArr[2] + ($calArr[3] - $calArr[6]) - ($totaldiscount - $discountVAT);
     if ($cart['total'] <= 0) {
         $cart['subtotal_excl_vat'] = 0;
     }
     $cart['product_subtotal'] = $calArr[1];
     $cart['product_subtotal_excl_vat'] = $calArr[2];
     $cart['shipping'] = $calArr[3];
     $cart['tax'] = $tax;
     $cart['sub_total_vat'] = $tax + $calArr[6];
     $cart['discount_vat'] = $discountVAT;
     $cart['shipping_tax'] = $calArr[6];
     $cart['discount_ex_vat'] = $totaldiscount - $discountVAT;
     $cart['mod_cart_total'] = $this->_carthelper->GetCartModuleCalc($cart);
     $session->set('cart', $cart);
     return $cart;
 }
开发者ID:,项目名称:,代码行数:65,代码来源:

示例2:

    if ($product_price >= $texpricemin && $product_price <= $texpricemax && $count > 0) {
        $k++;
        $count--;
        ?>
			<tr>
				<td>
					<?php 
        $thum_image = $producthelper->getProductImage($row->product_id, $link, $thumbwidth, $thumbheight);
        echo "<div class='mod_redshop_pricefilter'>";
        if ($image) {
            echo $thum_image . "<br>";
        }
        echo "<a href='" . $link . "'>" . $row->product_name . "</a><br>";
        $productArr = $producthelper->getProductNetPrice($row->product_id);
        $product_price_discount = $productArr['productPrice'] + $productArr['productVat'];
        $taxexempt_addtocart = $producthelper->taxexempt_addtocart();
        if (!$row->not_for_sale && $show_price && $taxexempt_addtocart) {
            if (SHOW_PRICE && (!DEFAULT_QUOTATION_MODE || DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE)) {
                if (!$product_price) {
                    $product_price_dis = $producthelper->getPriceReplacement($product_price);
                } else {
                    $product_price_dis = $producthelper->getProductFormattedPrice($product_price);
                }
                $pricetext = "";
                $disply_text = "<div class='mod_redproducts_price'>" . $product_price_dis . "</div>";
                if ($row->product_on_sale && $product_price_discount > 0) {
                    if ($product_price > $product_price_discount) {
                        $disply_text = "";
                        $s_price = $product_price - $product_price_discount;
                        $tmpprcie = $product_price_discount;
                        if ($show_discountpricelayout) {
开发者ID:,项目名称:,代码行数:31,代码来源:


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