Beispiel #1
0
	function generateConfirmCart($payment_method) {
		$array = array();
		$cart = oseMscPublic::getCart();
		// begin to count tax
		$country = JRequest::getCmd('bill_country', null);
		$state = JRequest::getCmd('bill_state', 'all');
		$taxParams = oseMscPublic::getTax($country, $state);
		$cart = oseMscPublic::getCart();
		$cart->updateTaxParams('country', $country);
		$cart->updateTaxParams('state', $state);
		$cart->updateTaxParams('rate', $taxParams['rate']);
		$cart->updateTaxParams('file_control', $taxParams['file_control']);
		$cart->updateTaxParams('has_file_control', $taxParams['has_file_control']);
		$cart->updateTaxParams('vat_number', $taxParams['vat_number']);
		$cart->refreshSubTotal();
		// end
		$items = $cart->get('items');
		$subtotal = oseMscPublic::getSubtotal();
		$total = $cart->get('total');
		$discount = $cart->get('discount');
		$msc = oseRegistry::call('msc');
		// begin to draw the confirm box
		$draw = new oseMscListDraw();
		$payment = oseRegistry::call('payment');
		$osePaymentCurrency = oseMscPublic::getSelectedCurrency();
		$paymentView = $payment->getInstance('View');
		$keys = array_keys($items);
		$payment_mode = $cart->getParams('payment_mode');
		if (strtolower($payment_mode) == "paypal_cc") {
			$payment_mode = JText::_("Credit Card");
		}
		$paymentPre = ($payment_mode == 'm') ? 'Manual Re-Billing ' : 'Automatic Re-Billing ';
		$tHtml = '<table width="100%"><th width="76%" class="first">Item</th><th width="10%">Length</th><th width="10%" class="last">Price</th>';
		foreach ($items as $item) {
			$msc_id = oseObject::getValue($item, 'entry_id');
			$msc_option = oseObject::getValue($item, 'msc_option');
			if ($payment_mode == 'm') {
				$rows = array();
				$rows['title'] = $draw->drawFirstTitle(oseObject::getValue($item, 'title'), oseObject::getValue($item, 'leaf'));
				$rows['recurrence'] = oseObject::getValue($item, 'standard_recurrence');
				$rows['price'] = oseObject::getValue($item, 'standard_price');
				$tHtml .= '<tr><td>' . implode('</td><td>', $rows) . '</td></tr>';
			}
		}
		$tHtml .= '</table>';
		$array['items'] = '<div id="osecart-items">' . $tHtml . '</div>';
		$array['payment_preference'] = '<div id="ose-confirm-preference">Payment Preference: ' . $paymentPre . '</div>';
		$gwInfo = oseRegistry::call('payment')->getInstance('GateWay')->getGWInfo($payment_method);
		if (!empty($gwInfo) && $gwInfo->is_cc) {
			$array['payment_method'] = '<div id="ose-confirm-method">Payment Method: Credit Card</div>';
			;
		} else {
			$array['payment_method'] = '<div id="ose-confirm-method">Payment Method: ' . ucfirst($payment_method) . '</div>';
		}
		$array['subtotal'] = '<div id="osetotalcosts"><div class="items">Subtotal: ' . $osePaymentCurrency . ' ' . $subtotal . '</div>';
		$array['discount'] = '<div class="items">Discount: ' . $osePaymentCurrency . ' ' . $discount . '</div>';
		$array['tax'] = '<div class="items">Tax: ' . $osePaymentCurrency . ' ' . $cart->getTaxParams('amount', '0.00') . '</div>';
		$array['total'] = '<div class="items" id ="osegradntotal">Grand Total: ' . $osePaymentCurrency . ' ' . $total . '</div></div>';
		if (is_array($array)) {
			$array = implode("\r\n", $array);
		}
		$divSelectedRow = $draw->drawDiv('ose-selected-row');
		$html = sprintf($divSelectedRow, "\r\n" . $array . "\r\n");
		return $html;
	}
Beispiel #2
0
	function generateConfirmCart($payment_method) {
		$array = array();
		$cart = oseMscPublic::getCart();
		$items = $cart->get('items');
		$subtotal = oseMscPublic::getSubtotal();
		$total = $cart->get('total');
		$discount = $cart->get('discount');
		$msc = oseRegistry::call('msc');
		$draw = new oseMscListDraw();
		$payment = oseRegistry::call('payment');
		$osePaymentCurrency = oseMscPublic::getSelectedCurrency();
		$paymentView = $payment->getInstance('View');
		$keys = array_keys($items);
		$payment_mode = $cart->getParams('payment_mode');
		$paymentPre = ($payment_mode == 'm') ? 'Manual Re-Billing ' : 'Automatic Re-Billing ';
		$tHtml = '<table width="100%"><th width="76%" class="first">Item</th><th width="10%">Length</th><th width="10%" class="last">Price</th>';
		foreach ($items as $item) {
			$msc_id = oseObject::getValue($item, 'entry_id');
			$msc_option = oseObject::getValue($item, 'msc_option');
			if ($payment_mode == 'm') {
				$rows = array();
				$rows['title'] = $draw->drawFirstTitle(oseObject::getValue($item, 'title'), oseObject::getValue($item, 'leaf'));
				$rows['recurrence'] = oseObject::getValue($item, 'standard_recurrence');
				$rows['price'] = oseObject::getValue($item, 'standard_price');
				$tHtml .= '<tr><td>' . implode('</td><td>', $rows) . '</td></tr>';
			}
		}
		$tHtml .= '</table>';
		$array['items'] = '<div id="osecart-items">' . $tHtml . '</div>';
		$array['subtotal'] = '<div id="osetotalcosts"><div class="items">Subtotal: ' . $osePaymentCurrency . ' ' . $subtotal . '</div>';
		$array['discount'] = '<div class="items">Discount: ' . $osePaymentCurrency . ' ' . $discount . '</div>';
		$array['total'] = '<div class="items" id ="osegradntotal">Grand Total: ' . $osePaymentCurrency . ' ' . $total . '</div></div>';
		$array['payment_preference'] = '<div id="ose-confirm-preference">Payment Preference: ' . $paymentPre . '</div>';
		if ($payment_method == 'authorize' || $payment_method == 'paypal_cc' || $payment_method == 'eway') {
			$array['payment_method'] = '<div id="ose-confirm-method">Payment Method: Credit Card</div>';
			;
		} else {
			$array['payment_method'] = '<div id="ose-confirm-method">Payment Method: ' . ucfirst($payment_method) . '</div>';
		}
		if (is_array($array)) {
			$array = implode("\r\n", $array);
		}
		$divSelectedRow = $draw->drawDiv('ose-selected-row');
		$html = sprintf($divSelectedRow, "\r\n" . $array . "\r\n");
		return $html;
	}
	function getCurrencyList()
	{
		$List = oseRegistry::call('msc')->getCurrencyList();

		$currency = oseMscPublic::getSelectedCurrency();

		$options = array();
		foreach($List as $key => $value)
		{
			$options[] = JHTML::_('select.option',  $value['currency'], $value['currency']);
		}


		$combo = JHTML::_('select.genericlist',  $options, 'ose_currency', 'onChange="javascript:oseMsc.reg.reload()" class="ose_currency"  size="1" style="width:200px"', 'value', 'text', $currency );

		return $combo;
	}
Beispiel #4
0
			<div class='items' id="ose-currency-transmit">Currency:<span id="ose-currency-combo"><?php echo $currencyCombo;?></span></div>
			<div class='items' id="ose-payment-mode">Payment Mode:<span id="ose-payment-mode-combo"><?php echo $paymentModeCombo;?></span></div>
		</div>

	   <div id='osecart-items'>
		<table width='100%'>
			<thead class='osecart-header'>
				<th class='items' colspan='2'><?php echo JText::_('Item');?></th>
				<th class='items'><?php echo JText::_('Update');?></th>
				<th class='items'><?php echo JText::_('Price');?></th>
			</thead>

			<tbody>
<?php
		$price = array();
		$currency = oseMscPublic::getSelectedCurrency();
		foreach ($cartItems as $key => $item)
		{
			if(oseObject::getValue($item,'payment_mode') == 'm')
			{
				$paymentPrice = oseObject::getValue($item,'standard_price');
			}
			else
			{
				$has_trial = oseObject::getValue($item,'has_trial');
				$paymentPrice = empty($has_trial)?oseObject::getValue($item,'standard_price'):oseObject::getValue($item,'trial_price');
			}
			//$explode = str_replace($currency,'',$paymentPrice);
			//$price[] = trim($explode);
?>
			<tr class='purchased-items'>