USER GUIDE
- How to Register Module in Magento 2
- Tell Magento Which Extesions to Be Included
- Create Over Meta Title Remove Class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?php /* * Company Name: Cozmot Inc * Website: https://cozmot.com * Writer Name: Zaheer Ahmed * Contact: zaheercena@gmail.com * Number: +92-301-1000201 * Copyright: MIT Licence(Open to edit) */ ?> <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Cozmot_CategoryWidget', __DIR__ ); |
After Registering Tell Magento Which Extesions to Be Included
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?xml version="1.0" ?> <!--/* * Company Name: Cozmot Inc * Website: https://cozmot.com * Writer Name: Zaheer Ahmed * Contact: zaheercena@gmail.com * Number: +92-301-1000201 * Copyright: MIT Licence(Open to edit) */--> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Cozmot_CategoryWidget"/> </config> |
Now Module Registered so Try adding Widget XML Structure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
<?xml version="1.0" encoding="UTF-8"?> <!--/* * Company Name: Cozmot Inc * Website: https://cozmot.com * Writer Name: Zaheer Ahmed * Contact: zaheercena@gmail.com * Number: +92-301-1000201 * Copyright: MIT Licence(Open to edit) */--> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="catalog_category_list" class="Cozmot\CategoryWidget\Block\Category\Widget\CategoryList"> <label translate="true">New Cozmot Category Listing Widget</label> <description translate="true">Category Grid</description> <parameters> <parameter name="title" sort_order="10" visible="true" xsi:type="text"> <label>Section Heading</label> </parameter> <parameter name="filter-selection" xsi:type="select" visible="true"> <label translate="true">Select Filter(optional)</label> <options> <option name="most" value="0" selected="true"> <label translate="true">New Arrivals</label> </option> <option name="sale" value="1"> <label translate="true">Sale</label> </option> <option name="featured" value="2"> <label translate="true">Featured</label> </option> </options> </parameter> <parameter name="page_size" xsi:type="text" required="true" visible="true"> <label translate="true">Number of Category to display</label> <value>5</value> </parameter> <parameter name="condition" xsi:type="conditions" visible="true" required="true" sort_order="10" class="Magento\CatalogWidget\Block\Product\Widget\Conditions"> <label translate="true">Conditions</label> </parameter> <parameter name="template" xsi:type="select" required="true" visible="true"> <label>Template</label> <options> <option name="grid" value="category/widget/grid.phtml" selected="true"> <label translate="true">Category Grid Template</label> </option> <option name="sidebar" value="category/widget/sidebar.phtml"> <label translate="true">Category Sidebar Template</label> </option> </options> </parameter> <parameter name="chart_layout" xsi:type="select" visible="true"> <label translate="true">Show in Slider</label> <options> <option name="yes" value="1" selected="true"> <label translate="true">Yes</label> </option> <option name="no" value="0"> <label translate="true">No</label> </option> </options> </parameter> </parameters> <containers> <container name="sidebar.main"> <template name="default" value="sidebar" /> </container> <container name="content"> <template name="grid" value="grid" /> <template name="list" value="list" /> </container> <container name="sidebar.additional"> <template name="default" value="sidebar" /> </container> </containers> </widget> </widgets> |
Since we added all essential files so you better download and install Our Module to run featue out of Box Here is link to Widget Page [button link="https://cozmot.com/category-products-widget-with-custom-filters-magento-2/" type="big"] Link text[/button] ]]>