Esempio n. 1
0
 function getSubTotalFromCartContents()
 {
     $cart2 = new cart2();
     $cart = $cart2->readCart();
     $sub = 0;
     foreach ($cart as $cartproduct) {
         $sub += $cartproduct->quantity * $cartproduct->finalprice;
     }
     return $sub;
 }
Esempio n. 2
0
     break;
 case "checkout":
     $cart = new cart2();
     $cfg = new sc_configuration();
     $mintocheckout = $cfg->get("mincheckout");
     // check for minimum amount before checkout, default = 0 => any amount is enough
     if (!$mintocheckout) {
         $mintocheckout = 0;
     }
     $carttotal = $cart->getCartTotal();
     if ($carttotal < $mintocheckout) {
         $txt = JText::_('SC_LESS_THAN_MIN_AMOUNT', $mintocheckout);
         $mainframe->redirect("index.php?option=com_caddy&action=showcart&Itemid={$Itemid}", $txt);
     }
     $cart2 = new cart2();
     $cart = $cart2->readCart();
     $cfg = new sc_configuration();
     $pretextid = $cfg->get("pretextid");
     $posttextid = $cfg->get("posttextid");
     $db =& JFactory::getDBO();
     $query = "select * from #__content where id='{$pretextid}'";
     $db->setQuery($query);
     $pretext = $db->loadObject();
     $query = "select * from #__content where id='{$posttextid}'";
     $db->setQuery($query);
     $posttext = $db->loadObject();
     //is shipping enabled
     $cfg = new sc_configuration();
     $ship['enabled'] = $cfg->get("shippingenabled");
     //populate region list
     if ($ship['enabled']) {