- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where to find the renderLayout Controller
I am new to the Block / Layout concept, but trying hard to get an understanding of it.
I have a customer home.phtml, where I have this line :
(
[type] => catalog/product_list
[column_count] => 4
[category_id] => 67
[product_count] => 12
[attribute_filter] => price_sync::eq::0,price_sync::null::true
[template] => catalog/product/home.phtml
[block_params] => Array
(
[type] => catalog/product_list
[column_count] => 4
[category_id] => 67
[product_count] => 12
[attribute_filter] => price_sync::eq::0,price_sync::null::true
[template] => catalog/product/home.phtml
)
[module_name] => Dbaux_CPAsSubProduct_Catalog
)
So, what I am trying to find is where is this value getting set. Please let me know if I can do anything.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Where to find the renderLayout Controller
As shared code I can see you are calling blocks for products on home page.
It's catalog product list block, you can find app/code/core/Mage/Catalog/Block/Product/List.php. In this file, you can see many methods: getLoadedProductCollection(), _getProductCollection(),setCategoryId(), getCategoryId(), etc. For example: when you set category_id = 2 => getCategoryId() will get your category id = 2. In your template, it will calls a function $this->getLoadedProductCollection() .
https://www.manishmittal.com/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Where to find the renderLayout Controller
And I am trying to understand how its loaded in the $this object.
if ($this->getCategoryId()) {
Edit : Infact inside _beforeToHtml() method only $this is having the category Id values.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Where to find the renderLayout Controller
Here $this is block class you can find out this class using
echo get_class($this);
You can check this class where you can find defined render layout for this.
https://www.manishmittal.com/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Where to find the renderLayout Controller
I get my custom
Which when called _getProductCollection calls parent::_getProductCollection
But in the custom class there is no place where I am setting the categoryId.
Is it possible that the $this variable is getting value from some other class?