How we can create Joomla menus using excel sheet of 2k rows?. I created the script but it gets time out after certain number of insertion i.e. 50 or 100 sometime.
foreach($finalData as $key=>$val)
{
echo $key."<br/>";
$params = [
"service_description" => $val[7],
"contact_number" => $val[8],
"contact_email" => $val[9],
"keywords" => $val[10],
"price" => $val[11],
"banner" => $defaultBanner,
"menu-anchor_title" => "",
"menu-anchor_css" => "",
"menu_image" => "",
"menu_image_css" => "",
"menu_text" => 1,
"menu_show" => 1,
"page_title" => "",
"show_page_heading" => "",
"page_heading" => "",
"pageclass_sfx" => "",
"menu-meta_description" => $val[7],
"menu-meta_keywords" => $val[10],
"robots" => "",
"secure" => 0
];
$custom_data = [
"parent_id" => $jinput->get("parent_id"),
"level" => 2,
"menutype" => "mainmenu",
"title" => "Sameday and On Board Couriers in ".$val[2],
"type" => "component",
"link" => "index.php?option=com_couriercsv&view=courier",
"published" => 1,
"browserNav" => 0,
"access" => 1,
"template_style_id" => 0,
"params" => json_encode($params),
"home" => 0,
"language" => "*",
"client_id" => 0,
"component_id" => $component->extension_id
];
$menu = JTable::getInstance('Menu','MenusTable');
// menu if present
$menu->load(0);
$menu->setLocation($custom_data['parent_id'], 'last-child');
$menu->bind($custom_data);
$menu->store();
if($menu->id)
{
$menu->rebuildPath($menu->id);
// store the menu id
}
}