Request Quote

Creating Side Menu in X-Cart Admin Area

We are considering that your are using the x-cart( version 5.3 or above). Now let’s learn that how to list a Side Menu in x-cart admin area for our module. Please follow as given below:


First You need to create an empty module for which you want a side menu in admin area of x-cart. For example: Here I am creating a module which Developer Id as Webkul and Module Id as SideMenu.


You need to decorate your SideMenu Class (\Xlite\View\Menu\Admin\SideMenu) in your module. For that you have to create SideMenu.php file in your module at the path (/classes/Xlite/Module/Webkul/SideMenu/View/Menu/Admin/SideMenu .php) with the code of content given below:

// vim: set ts=4 sw=4 sts=4 et:

namespace XLite\Module\Webkul\SideMenu\View\Menu\Admin;

abstract class SideMenu extends \XLite\View\Menu\Admin\SideMenu implements \XLite\Base\IDecorator
     	* Define and set handler attributes; initialize handler
     	* @param array $params Handler params OPTIONAL
    	public function __construct(array $params = array())
        	if (!isset($this->relatedTargets['sub_side_menu1_controller_class_name'])) {
            		$this->relatedTargets['sub_side_menu1_controller_class_name'] = array('sub_side_menu1_controller_class_name');
     	* Define items
     	* @return array
    	protected function defineItems()
        	$list = parent::defineItems();
        	if (!isset($list['SideMenu'])) {
            		$list['SideMenu'] = array(
                			static::ITEM_TITLE    => static::t('Side Menu'),
                			static::ITEM_TARGET   => 'menus',
                			static::ITEM_WEIGHT   => 700,
                			static::ITEM_ICON_SVG => 'images/side_menu.svg',
                			static::ITEM_CHILDREN => array(),
       		$list['SideMenu'][static::ITEM_CHILDREN]['subscribers'] = array(
            		static::ITEM_TITLE  => static::t('Sub Side Menu 1'),
            		static::ITEM_TARGET => 'sub_side_menu_1_controller_class',
            		static::ITEM_WEIGHT => 200,
            		static::ITEM_ICON_SVG => 'images/sub_side_menu_1.svg',
        		$list['SideMenu'][static::ITEM_CHILDREN]['notif_tmplts'] = array(
            		static::ITEM_TITLE  => static::t('Sub Side Menu 2'),
            		static::ITEM_TARGET => 'sub_side_menu_2_controller_class',
            		static::ITEM_WEIGHT => 300,
            		static::ITEM_ICON_SVG => 'images/sub_side_menu_2.svg',
        		return $list;

After that you need to deploy your store and then the side menu is listing as given below :

Hope that will help you. Thank You 🙂
. . .


Add Your Comment

Be the first to comment.