In the previous chapters, we learned how we can configure the widget. Now it is time to show the widget.
We will create a custom block where we will write a query that returns the products for the given category, and we will set up a configuration to use two template files on the widget configuration page.
We will work further to create our own widget instance. Open the widget.xml
file that we created in the previous recipe.
The following steps describe how we configure a custom block with custom templates for the widget instance.
First, we will create a block class that extends the
Mage_Catalog_Block_Product_List
class. We do this because the behavior of that class is what we need for our widget.Create the
List.php
file underapp/code/local/Packt/Productslider/Block/Catalog/Product
.Add the following content to that file to initialize the class and the functions that we will configure:
<?php class Packt_Productslider_Block_Catalog_Product_List...