}
?>
      <form id='Cart66WidgetCartForm' action="" method="post">
        <input type='hidden' name='task' value='updateCart' />
          <table id='Cart66AdvancedWidgetCartTable' class="Cart66AdvancedWidgetCartTable">
            <?php 
$isShipped = false;
?>
            <?php 
foreach ($items as $itemIndex => $item) {
    ?>
              <?php 
    $product->load($item->getProductId());
    $productPrice = $item->getProductPrice();
    $productSubtotal = $item->getProductPrice() * $item->getQuantity();
    if ($product->isShipped()) {
        $isShipped = true;
    }
    ?>
              <tr class="product_items">
                <td>
                  <span class="Cart66ProductTitle"><?php 
    echo $item->getFullDisplayName();
    ?>
</span>
                  <span class="Cart66QuanPrice">
                    <span class="Cart66ProductQuantity"><?php 
    echo $item->getQuantity();
    ?>
</span> 
                    <span class="Cart66MetaSep">x</span> 
 public function isShipped()
 {
     $product = new Cart66Product($this->_productId);
     return $product->isShipped();
 }
 public function getShippingCost($methodId = null)
 {
     $setting = new Cart66Setting();
     $shipping = null;
     if (!$this->requireShipping()) {
         $shipping = 0;
     } elseif (Cart66Session::get('Cart66LiveRates') && get_class(Cart66Session::get('Cart66LiveRates')) == 'Cart66LiveRates' && Cart66Setting::getValue('use_live_rates')) {
         $liveRate = Cart66Session::get('Cart66LiveRates')->getSelected();
         if (is_numeric($liveRate->rate)) {
             $r = $liveRate->rate;
             return number_format($r, 2, '.', '');
         }
     } else {
         if ($methodId > 0) {
             $this->_shippingMethodId = $methodId;
         }
         if ($this->_shippingMethodId < 1) {
             $this->_setDefaultShippingMethodId();
         } else {
             // make sure shipping method exists otherwise reset to the default shipping method
             $method = new Cart66ShippingMethod();
             if (!$method->load($this->_shippingMethodId) || !empty($method->code)) {
                 Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Resetting the default shipping method id");
                 $this->_setDefaultShippingMethodId();
             }
         }
         $methodId = $this->_shippingMethodId;
         // Check for shipping rules first
         $shipping = 0;
         $isRuleSet = false;
         $rule = new Cart66ShippingRule();
         if (isset($methodId) && is_numeric($methodId)) {
             $rules = $rule->getModels("where shipping_method_id = {$methodId}", 'order by min_amount desc');
             if (count($rules)) {
                 $cartTotal = $this->getSubTotal();
                 foreach ($rules as $rule) {
                     if ($cartTotal > $rule->minAmount) {
                         $shipping = $rule->shippingCost;
                         $isRuleSet = true;
                         break;
                     }
                 }
             }
         }
         if (!$isRuleSet) {
             $product = new Cart66Product();
             $shipping = 0;
             $highestShipping = 0;
             $bundleShipping = 0;
             $highestId = 0;
             foreach ($this->_items as $item) {
                 $product->load($item->getProductId());
                 if ($highestId < 1) {
                     $highestId = $product->id;
                 }
                 if ($product->isShipped()) {
                     $shippingPrice = $product->getShippingPrice($methodId);
                     $bundleShippingPrice = $product->getBundleShippingPrice($methodId);
                     if ($shippingPrice > $highestShipping) {
                         $highestShipping = $shippingPrice;
                         $highestId = $product->id;
                     }
                     $bundleShipping += $bundleShippingPrice * $item->getQuantity();
                 }
             }
             if ($highestId > 0) {
                 $product->load($highestId);
                 $shippingPrice = $product->getShippingPrice($methodId);
                 $bundleShippingPrice = $product->getBundleShippingPrice($methodId);
                 $shipping = $shippingPrice + ($bundleShipping - $bundleShippingPrice);
             }
         }
     }
     $shipping = $shipping < 0 ? 0 : $shipping;
     return number_format($shipping, 2, '.', '');
 }