I need to add Megamenu via an install/upgrade script. I've added my megamenu
. I've figured out which tables get updated when I add Megamenu.
The table which gets updated is
mgs_megamenu
mgs_megamenu_store
How can I achieve it programmatically like for cms block I referred this link for cms block
The queries which I prepared for megamenu, requires lots of insert
and select
query1
INSERT INTO `mgs_megamenu`
(`title`,`menu_type`,`category_id`,`position`,`columns`,
`dropdown_position`,`use_thumbnail`,`static_content`,
`left_col`,`right_col`,`status`,`parent_id`,`store`) VALUES
('WHAT''S NEW',2,0,0,6,1,2,'<div class="mega-menu-content">
</div>',1,1,1,1,0);
query2
SET @mgs_megamenu_id = (SELECT max(megamenu_id) FROM mgs_megamenu);
query3
INSERT INTO `mgs_megamenu_store` (`megamenu_id`,`store_id`) VALUES (@mgs_megamenu_id ,0);
Modal class of MGS is
MGS\Mpanel\Model\Category;