<?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 if( $this->getTagInfo()->getName() ): ?>
    <div class="page-head">
        <h3><?php echo $this->__("Products tagged with '%s'", $this->htmlEscape($this->getTagInfo()->getName())) ?></h3>
    </div>
<?php endif; ?>
<?php echo $this->getListHtml() ?>
    <table class="data-table box-table" id="tags-table" cellspacing="0">
    <?php if( $this->getCount() > 0 ): ?>
        <col width="100" />
        <col />
        <col width="75" />
        <tbody>
        <?php $iterator = 0 ?>
        <?php foreach($this->getProducts() as $_product): ?>
            <tr<?php if($iterator % 2 == 0): ?> class="odd"<?php $iterator++;endif; ?>>
                <td><a href="<?php echo $_product->getProductUrl(); ?>"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(100, 100); ?>" alt="" height="100" width="100" /></a></td>
                <td>

                    <h5><a href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h5>
                    <?php echo $this->helper('catalog/product')->getPriceHtml($_product) ?>
                    <?php echo $this->helper('review/product')->getSummaryHtml($_product, 'short') ?>
                    <p><?php echo $this->htmlEscape($_product->getDescription()) ?></p>
                </td>
                <td class="a-center">
                    <button type="button" class="form-button" onclick="setLocation('<?php echo $this->getUrl('checkout/cart/add',array('product'=>$_product->getId())) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
                    <?php if ($this->helper('wishlist')->isAllow()) : ?>
                    <br /><a href="<?php echo $this->getUrl('wishlist/index/add',array('product'=>$_product->getId())) ?>"><?php echo $this->__('Add to Wishlist') ?></a>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    <?php else: ?>
            <tr>
            <td><p><?php echo $this->__("Unable to find any products tagged with '%s' in the current store", $this->htmlEscape($this->getTagInfo()->getName()) ) ?></p></td>
            </tr>
    <?php endif; ?>
    </table>
    <script type="text/javascript">decorateTable('tags-table')</script>
<?php echo $this->getListHtml() ?>
