2 added 571 characters in body
source | link

Your block should extend from product list I believe.

<?php
// app/code/local/Compx/Brandproducts/Block/Recentproducts.php
class Compx_Brandproducts_Block_Brandproducts 
  extends Mage_Catalog_Block_Product_List{ 
  //extends Mage_Core_Block_Template {

  public function getBrandProducts() {
    // call model to fetch data
    $arr_products = array();
    $products = Mage::getModel("brandproducts/brandproducts")->getBrandProducts();

    foreach ($products as $product) {
      $arr_products[] = array(
        'id' => $product­>getId(),
        'name' => $product->getName(),
        'url' => $product->getProductUrl(),
      );
    }

    return $arr_products;
  }
}
?>

And your model file

<?php
// app/code/local/Compx/Brandproducts/Model/Brandproducts.php
class Compx_Brandproducts_Model_Brandproducts 
extends Mage_Catalog_Model_Abstract{
//extends Mage_Core_Model_Abstract {
  public function getBrandProducts() {
  $products = Mage::getModel("catalog/product")->getCollection();
                $products->addAttributeToSelect('*')
                //->setOrder('entity_id', 'DESC')
                ->setPageSize(5);
    return $products;

  }
}

?>

Your block should extend from product list I believe.

<?php
// app/code/local/Compx/Brandproducts/Block/Recentproducts.php
class Compx_Brandproducts_Block_Brandproducts 
  extends Mage_Catalog_Block_Product_List{ 
  //extends Mage_Core_Block_Template {

  public function getBrandProducts() {
    // call model to fetch data
    $arr_products = array();
    $products = Mage::getModel("brandproducts/brandproducts")->getBrandProducts();

    foreach ($products as $product) {
      $arr_products[] = array(
        'id' => $product­>getId(),
        'name' => $product->getName(),
        'url' => $product->getProductUrl(),
      );
    }

    return $arr_products;
  }
}
?>

Your block should extend from product list I believe.

<?php
// app/code/local/Compx/Brandproducts/Block/Recentproducts.php
class Compx_Brandproducts_Block_Brandproducts 
  extends Mage_Catalog_Block_Product_List{ 
  //extends Mage_Core_Block_Template {

  public function getBrandProducts() {
    // call model to fetch data
    $arr_products = array();
    $products = Mage::getModel("brandproducts/brandproducts")->getBrandProducts();

    foreach ($products as $product) {
      $arr_products[] = array(
        'id' => $product­>getId(),
        'name' => $product->getName(),
        'url' => $product->getProductUrl(),
      );
    }

    return $arr_products;
  }
}
?>

And your model file

<?php
// app/code/local/Compx/Brandproducts/Model/Brandproducts.php
class Compx_Brandproducts_Model_Brandproducts 
extends Mage_Catalog_Model_Abstract{
//extends Mage_Core_Model_Abstract {
  public function getBrandProducts() {
  $products = Mage::getModel("catalog/product")->getCollection();
                $products->addAttributeToSelect('*')
                //->setOrder('entity_id', 'DESC')
                ->setPageSize(5);
    return $products;

  }
}

?>
1
source | link

Your block should extend from product list I believe.

<?php
// app/code/local/Compx/Brandproducts/Block/Recentproducts.php
class Compx_Brandproducts_Block_Brandproducts 
  extends Mage_Catalog_Block_Product_List{ 
  //extends Mage_Core_Block_Template {

  public function getBrandProducts() {
    // call model to fetch data
    $arr_products = array();
    $products = Mage::getModel("brandproducts/brandproducts")->getBrandProducts();

    foreach ($products as $product) {
      $arr_products[] = array(
        'id' => $product­>getId(),
        'name' => $product->getName(),
        'url' => $product->getProductUrl(),
      );
    }

    return $arr_products;
  }
}
?>