Do you like AbanteCart? Please rate AbanteCart or share your experience with other eCommerce entrepreneurs. Go to Softaculous rating page to add your rating or write a review

Create new admin parent menu and submenu

Started by yonghan, May 07, 2015, 06:05:06 AM

Previous topic - Next topic

yonghan

Hi admins, I'm trying to create admin parent menu and submenu in abantecart v1.2.

Here are the codes that I use on install.php

$menu = new AMenu ( "admin" );
$menu->insertMenuItem ( array (
        "item_id" => "test",
        "parent_id"=> "",
        "item_text" => "Test Menu",
        "item_url" => "",
        "item_type"=> "core",
        "item_icon_rl_id" => $resource_id,
        "sort_order"=>"8")
);

$this->registry->get('cache')->delete('admin_menu');

$content =$menu->insertMenuItem ( array (
        "item_id" => "test_submenu",
        "parent_id"=> "test",
        "item_text" => "Submenu",
        "item_url" => "",
        "item_type"=> "core",
        "item_icon_rl_id" => $resource_id_sales,
        "sort_order"=>"")
);


$file = fopen('hasil.txt', 'w');
fwrite($file, $content);
fclose($file);


I got Error: Cannot to add menu item because parent "test" is not exists

Is it possible for me to create new parent menu and submenu? Thanks


yonghan

Thanks Basara, I'm using the second method and it works.

Forum Rules Code of conduct
AbanteCart.com 2010 -