<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_Mobile
 * @copyright  Copyright (c) 2010-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */
?>
<?php $_product = $this->getProduct() ?>
<?php $_associatedProducts = $this->getAssociatedProducts() ?>
<?php if($_product->isSaleable() && count($_associatedProducts)): ?>
    <p><?php echo $this->__('Availability: In stock.') ?></p>
<?php else: ?>
    <p><?php echo $this->__('Availability: Out of stock.') ?></p>
<?php endif; ?>
<?php echo $this->getChildHtml('product_type_data_extra') ?>
<table cellspacing="0" class="shopping-cart product-data">
    <col />
    <col />
    <col width="1" />
    <thead>
        <tr>
            <th class="a-center" ><?php echo $this->__('Product Name') ?></th>
            <th class="a-center"><?php echo $this->__('Price') ?></th>
            <?php if ($_product->isSaleable()): ?>
            <th class="a-center"><?php echo $this->__('Qty') ?></th>
            <?php endif; ?>
        </tr>
    </thead>
    <tbody>
    <?php if (count($_associatedProducts)): ?>
    <?php foreach ($_associatedProducts as $_item): ?>
        <tr>
            <td><?php echo $this->htmlEscape($_item->getName()) ?></td>
            <td class="a-right">
                <?php echo $this->getPriceHtml($_item, true) ?>
                <?php echo $this->getTierPriceHtml($_item) ?>
            </td>
            <?php if ($_product->isSaleable()): ?>
            <td class="a-center">
            <?php if ($_item->isSaleable()) : ?>
                <input name="super_group[<?php echo $_item->getId() ?>]" value="<?php echo $_item->getQty()*1 ?>" type="text" class="input-text qty" />
            <?php else: ?>
                <?php echo $this->__('Out of stock.') ?>
            <?php endif; ?>
            </td>
            <?php endif; ?>
        </tr>
    <?php endforeach; ?>
    <?php else: ?>
       <tr>
           <td colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>"><?php echo $this->__('No options of this product are available.') ?></td>
       </tr>
    <?php endif; ?>
    </tbody>
</table>
