magento codes to access module to any other pages like category,product details etc

$val=$_GET['advertiser_name'];   
$a = Mage::getModel("storeband_storebrand/storebrands")->getCollection()->addAttributeToSelect('*');
//->addAttributeToFilter('advertiser_name');
   



here  Storeband_storebrand is module name and storebrands is model name



u will get the moule in name of module/etc/config


<config>
    <modules>
        <Storeband_Storebrand>
            <version>1.0.0</version>
        </Storeband_Storebrand>
    </modules>






and model name in






 <models>
            <storeband_storebrand>
                <class>Storeband_Storebrand_Model</class>
                <resourceModel>storeband_storebrand_resource</resourceModel>
            </storeband_storebrand>
            <storeband_storebrand_resource>




here storeband_is a name space and storebrand is model name
//echo $a[0][1];
//echo '<pre>';
//print_r($a);
//echo $val;

foreach ($a as $b)
    {
       
       
        if($b->getBrandAttr()==$val )
        {
            ?>
       
        <div class="row item-bg01">
       
             <div class="col-md-3">
                 <div class="img-bg">
             <img src="<?php echo Mage::helper('storeband_storebrand/storebrands_image')->init($b, 'brand_images')->resize(175);?>" alt="<?php echo $this->htmlEscape($b->getComment());?>" />
             </div>
             </div>
            
            
             <div class="col-md-9 item-text01">
             <?php
             echo $b->getBrandDescriptions();
              ?>
              </div>
       
        </div>
           
       

   
        <?php
   
    }
    }















Comments

Popular Posts

Magmi Single and Multiple Category Importer