문제

i want to display discount coupons in products page left side bar as new offers ,It is possible or not . how can i implement new offers and how can i display these in left side bar with checkbox selection option.
Please help me if it is possible ,

Thanks

도움이 되었습니까?

해결책

Shakir,can call using xml.Follow below step for this work

Step1: Goto app/design/frontend/yourpackage/youtemplate/layout/catalog.xml

<catalog_product_view>
.......
<reference name="left">
            <block type="core/template" name="catalog.product.leftcoupn" before="-" template="catalog/product/view/showcoupon.phtml"/>
        </reference>

 </catalog_product_view>

Step then add an file under app/design/frontend/yourpackage/youtemplate/template/catalog/product/viewshowcoupon.phtml and Code of showcoupon.phtml is

 <?php
  /** @var $collection Mage_SalesRule_Model_Mysql4_Rule_Collection */
            $collection = Mage::getModel('salesrule/rule')
                ->getResourceCollection()->addFieldTOFilter('is_active',1);
            $collection->addWebsitesToResult();
    foreach($collection as $each){
    echo "<pre>";
    //print_r($each);
    echo "</pre>";
    echo $each->getName().'<br/>';
    echo $each->getCoupon_code().'<br/>';
    echo $each->getFromDate().'<br/>';
    echo $each->getToDate().'<br/>';
    echo $each->getIsActive().'<br/>';

    }
    ?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top