Skip to main content
added 310 characters in body
Source Link
sivakumar
  • 307
  • 10
  • 35
  • 69

I'm giving just idea.not a complete solution.

in view.php

public function getProductListHtml()
    {
    return $this->getChildHtml('product_list')
    }

So you can modify like this

public function getProductListHtml($category_id)
    {
 $this->getChild('product_list')->setData('category_id', $category_id);
    return  $this->getChildHtml('product_list', false);
    
    }

You can get the category id in list.phtml with $this->getCategoryId()

second solution with out modifying core block(view.php): remove echo $this->getProductListHtml() and directly you can put below lines in view.phtml

$this->getChild('product_list')->setData('category_id', $category_id);
    echo  $this->getChildHtml('product_list', false);

I'm giving just idea.not a complete solution.

in view.php

public function getProductListHtml()
    {
    return $this->getChildHtml('product_list')
    }

So you can modify like this

public function getProductListHtml($category_id)
    {
 $this->getChild('product_list')->setData('category_id', $category_id);
    return  $this->getChildHtml('product_list', false);
    
    }

You can get the category id in list.phtml with $this->getCategoryId()

I'm giving just idea.not a complete solution.

in view.php

public function getProductListHtml()
    {
    return $this->getChildHtml('product_list')
    }

So you can modify like this

public function getProductListHtml($category_id)
    {
 $this->getChild('product_list')->setData('category_id', $category_id);
    return  $this->getChildHtml('product_list', false);
    
    }

You can get the category id in list.phtml with $this->getCategoryId()

second solution with out modifying core block(view.php): remove echo $this->getProductListHtml() and directly you can put below lines in view.phtml

$this->getChild('product_list')->setData('category_id', $category_id);
    echo  $this->getChildHtml('product_list', false);
Source Link
sivakumar
  • 307
  • 10
  • 35
  • 69

I'm giving just idea.not a complete solution.

in view.php

public function getProductListHtml()
    {
    return $this->getChildHtml('product_list')
    }

So you can modify like this

public function getProductListHtml($category_id)
    {
 $this->getChild('product_list')->setData('category_id', $category_id);
    return  $this->getChildHtml('product_list', false);
    
    }

You can get the category id in list.phtml with $this->getCategoryId()