introtext; display::showCart($cart, true); echo $posttext->introtext; } function showCart($cart, $romode=null) { // $romode = readonly mode when checking out jimport('joomla.error.log'); $log = &JLog::getInstance(); global $mainframe; $debug=0; $mainframe->addCustomHeadTag(''); $showhidden="hidden"; if ($debug==1) $showhidden="text"; $line=__LINE__; $cfg=new sc_configuration(); $tsep=$cfg->get('thousand_sep'); $dsep=$cfg->get('decimal_sep'); $decs=$cfg->get('decimals'); $currency=$cfg->get('currency'); $curralign=$cfg->get('curralign'); $showremove=$cfg->get('remove_button'); $show_emptycart=$cfg->get('show_emptycart'); $currency=$cfg->get('currency'); $currleftalign=$cfg->get('curralign'); $stdprodcode=$cfg->get("cart_fee_product"); $cfp=$cfg->get ("taxrate"); $cfp=str_replace("%", "", $cfp); if ($cfp>1) { $cfp=$cfp/100; } $taxrate=$cfp; $gtotal=0; $html = ""; //$html = "\n
"; //$html .= "\n
\n
".JText::_('SC_CODE')."
\n
".JText::_('SC_DESCRIPTION')."
\n
".JText::_('SC_PRICE_PER_UNIT')."
\n
".JText::_('SC_QUANTITY')."
\n
".JText::_('SC_TOTAL')."
\n
 
"; //$html .= "\n
\n
Endpoint
\n
".JText::_('SC_DESCRIPTION')."
\n
 
"; $emptycart=true; if (!is_array($cart)) $cart=array(); $joined_codes = ""; $html = ""; $html .= "\n\n\n\n"; foreach ($cart as $key=>$cartproduct) { $formname=uniqid("Z"); $html2 = ""; $html2 .= ""; $html2 .= "\n"; $html2 .= "\n"; // $html2 = ""; // $html2 .= "\n
$cartproduct->prodcode
"; // $html2 .= "\n
".urldecode($cartproduct->prodname)." - ".urldecode($cartproduct->option)."
"; $joined_codes = $joined_codes . $cartproduct->prodcode . ","; $log->addEntry(array('level' => 'Debug', 'comment' => '\$cartproduct->prodcode ' . $cartproduct->prodcode)); /* Hide the price, quantity and total cost per item $pu = number_format($cartproduct->finalprice, $decs, $dsep, $tsep); if ($currleftalign==1) { $html2 .= "\n
$currency ".$pu."
"; } else { $html2 .= "\n
$pu $currency
"; } $html2 .= "\n
"; if ((!$romode) and ($cartproduct->prodcode!=$stdprodcode)) { $html2 .= "\n"; } else { $html2 .= $cartproduct->quantity; } $html2 .= "
"; $html2 .= "\n
"; $total=$cartproduct->quantity*$cartproduct->finalprice; $nombre_format = number_format($total, $decs, $dsep, $tsep); $gtotal= $gtotal + $total; if ($currleftalign==1) { $html2 .= "$currency ".$nombre_format; } else { $html2 .= $nombre_format." $currency"; } */ // Because the remove item sets the quantity to 0, the edtqty control still needs to appear on the form, keeping it hidden //$html2 .= "
\n
"; /* Hide the Change control if ((!$romode) and ($cartproduct->prodcode!=$stdprodcode)) { $html2 .= "\n"; } else { $html2 .= " "; } */ $html2 .= "\n
"; $html2 .= "\n"; $html2 .="\n"; $html2 .= "\n"; $html2 .= "\n"; $html2 .= "\n"; $html2 .= "\n"; $html2 .= "\n"; $html2 .= "\n"; //$html2 .= ""; $html2 .= ""; $html2 .= ""; if ($cartproduct->quantity) { $html .= $html2; // only add to display when qty != zero ! $emptycart=false; } } $html .= "\n
Endpoint".JText::_('SC_DESCRIPTION')." 
$cartproduct->prodcodelink . "\">". urldecode($cartproduct->prodname).""; if ($showremove==1 AND !$romode and ($cartproduct->prodcode!=$stdprodcode)) { $html2 .= "\n"; } $html2 .= "
"; // if ($taxrate>0) { // $html .= "\n
"; // $html .= "
".JText::_('SC_SUBTOTAL')."
"; // } // if ($taxrate>0) { // if ($currleftalign==1) { // $html .= "\n
$currency ".number_format($gtotal, $decs, $dsep, $tsep)."
"; // } // else { // $html .= "\n
".number_format($gtotal, $decs, $dsep, $tsep)." $currency
"; // } // $html .= "
"; // // $html .= "\n
"; // $html .= "
".JText::_('SC_TAX')."
"; // if ($currleftalign==1) { // $html .= "\n
$currency ".number_format($gtotal*$taxrate, $decs, $dsep, $tsep)."
"; // } // else { // $html .= "\n
".number_format($gtotal*$taxrate, $decs, $dsep, $tsep)." $currency
"; // } // $html .= "
"; // } /* Hide the Total cost bit $html .= "
"; $html .= "
".JText::_('SC_TOTAL')."
"; if ($currleftalign==1) { $html .= "\n
$currency ".number_format($gtotal+$gtotal*$taxrate, $decs, $dsep, $tsep)."
"; } else { $html .= "\n
".number_format($gtotal+$gtotal*$taxrate, $decs, $dsep, $tsep)." $currency
"; } $html .= "
"; */ $html .= "
"; $html .= "\n
"; if (!$romode) { #$html .= "\n"; $html .= "\n"; } else { $html .= " "; } $html .= "\n"; if ($show_emptycart==1) { $html .= "\n"; } // change the checkout button to Visualise $joined_codes = rtrim($joined_codes, ","); $base_url = JURI::base(); $target_url = $base_url . "index.php/data-visualisation?ENDPOINT=" . $joined_codes; $html .= "\n"; $html .= "\n"; /* the old input buttons if (!$romode) { $html .= "\n"; $html .= "\n"; } else { $html .= "\n"; $html .= "\n"; } */ $html .="
"; $html .= "
"; if ($emptycart) { $html=JText::_('SC_CART_EMPTY'); } $html .= "
"; echo $html; if ($debug==1) echo $line; } function showMyDetails($formfields, $errormessage=null, $fielddata=array()) { $line=__LINE__; ?>
"; } $n=count($formfields); $first=true; // echo ""; foreach ($formfields as $field) { echo ""; echo ""; echo ""; if ($first) { echo ""; $first=false; } echo ""; } ?>
$errormessage
 text
"; echo $field->caption; echo ""; switch($field->type) { case "text": echo ""; break; case "textarea": echo ""; break; case "radio": break; } echo $field->required ? "".JText::_('SC_REQUIRED')."" : ""; echo ""; echo "