JHTML::_('behavior.tooltip'); $canSeePrices = $this->canSeePrices; $infiniteCredit = $this->infiniteCredit; $canPayWithMoneyOrder = $this->canPayWithMoneyOrder; $canSeeFreeMethod = $this->canSeeFreeMethod; $canSeeTestMethod = $this->canSeeTestMethod; $canSeeGiroMethod = $this->canSeeGiroMethod; $canPayByInvoice = $this->canPayByInvoice; $canPayByCreditCard = $this->canPayByCreditCard; $canPayByReceipt = $this->canPayByReceipt; $canSeeSamplesMethod = $this->canSeeSamplesMethod; $cannotPay = $this->cannotPay; $canPayByCashOnDelivery = $this->canPayByCashOnDelivery; $userPaymentCharge = $this->userPaymentCharge; $modelAgency = $this->modelAgency; $modelUser = $this->modelUser; $userId = LegacyHelper::getUserId(); $franchiseName = SiteOptionsHelper::getFranchiseName(); $isPPR = ($franchiseName=='ppr'); $credit = $this->credit; $subtotal = 0; if (is_array($this->orders)) foreach($this->orders as $order) $subtotal+=$order->price; $subtotal = round($subtotal,2); $shippingCostInfo = $modelAgency->getShippingCostInfo($modelUser, count($this->orders)); $shipping_cost = $shippingCostInfo['price']; $shipping_vat = $shippingCostInfo['vat']; $method = JRequest::getVar('method'); if ($method!='BUDGET' && $method!='CASHONDELIVERY') $vatamount = round((float)($this->vat)/100.0*$subtotal,2); else $vatamount = 0; $equiv_chargeamount = round((float)($this->equivalence_charge)/100.0*$subtotal,2); $deliveryNotesCost = 0; if (is_array($this->deliveryNotes)) foreach ($this->deliveryNotes as $deliveryNote) $deliveryNotesCost += $deliveryNote->total; $pickupAtWarehouse = false; $selectedAgency = JRequest::getVar('agency'); $hideShipping = false; if (count($this->agencies)) { if (!$selectedAgency) $selectedAgency = $this->agencies[0]->id; foreach($this->agencies as $agency) if ($agency->id == $selectedAgency && $agency->name == 'Pick up at warehouse') $pickupAtWarehouse = true; } else $hideShipping = true; $selectedAddress = JRequest::getVar('shipping_address'); if (count($this->addresses)>0) { if (!$selectedAddress) $selectedAddress =$this->addresses[0]->id; } else $selectedAddress = -1; $shippingVatAmount = round($shipping_cost*$shipping_vat/100.0,2); $totalShippingCost = round($shipping_cost + $shippingVatAmount ,2); $subTotalComplete = $subtotal + $vatamount + $deliveryNotesCost + $totalShippingCost; $extraPaymentCost = round($subTotalComplete*$userPaymentCharge/100.0,2); $total = round($subTotalComplete + $equiv_chargeamount +$extraPaymentCost,2); $creditLimit = $this->creditLimit; $realCredit = round($credit + $creditLimit,2); $enoughCredit = (($realCredit-$total)>=0 || $infiniteCredit); if (!$enoughCredit && $method == "CREDIT") { $method = ''; JRequest::setVar('method',''); } ?>