sohel wrote:after <body> tag and also before @RenderBody() code
Path: Th
emes\{yourThemeName}\Views\Shared\_Root.Head.cshtml
Please Advise this is correct ?
@using Nop.Core
@using Nop.Core.Domain;
@using Nop.Core.Domain.Common;
@using Nop.Core.Domain.Seo
@using Nop.Services.Events
@using Nop.Services.Localization
@using Nop.Services.Configuration;
@using Nop.Services.Security;
@using Nop.Web.Framework.Events
@inject CommonSettings commonSettings
@inject IEventPublisher eventPublisher
@inject IPermissionService permissionService
@inject IWorkContext workContext
@inject SeoSettings seoSettings
@inject StoreInformationSettings storeInformationSettings
@inject IStoreContext storeContext
@inject ISettingService settingService
@inject Nop.Services.Localization.ILanguageService languageService
@{
Html.AppendScriptParts(ResourceLocation.Footer, "~/js/public.countryselect.js");
var displayMiniProfiler = storeInformationSettings.DisplayMiniProfilerInPublicStore
&& (!storeInformationSettings.DisplayMiniProfilerForAdminOnly || permissionService.Authorize(StandardPermissionProvider.AccessAdminPanel));
Html.AppendScriptParts(ResourceLocation.Footer, "~/js/public.ajaxcart.js");
Html.AppendScriptParts(ResourceLocation.Footer, "~/js/public.common.js");
//when jQuery migrate script logging is active you will see the log in the browser console
var iosFixFilePath = "~/Plugins/SevenSpikes.Core/Scripts/iOS-12-array-reverse-fix.min.js";
var iosFixContentFilePath = CommonHelper.DefaultFileProvider.MapPath(iosFixFilePath);
if(System.IO.File.Exists(iosFixContentFilePath))
{
Html.AppendScriptParts(ResourceLocation.Footer, iosFixFilePath);
}
if (commonSettings.JqueryMigrateScriptLoggingActive)
{
Html.AppendScriptParts(ResourceLocation.Footer, "~/lib/jquery-migrate/jquery-migrate-3.0.1.js");
}
else
{
Html.AppendScriptParts(ResourceLocation.Footer, "~/lib/jquery-migrate/jquery-migrate-3.0.1.min.js");
}
Html.AppendScriptParts(ResourceLocation.Footer, "~/lib/jquery-ui/jquery-ui-1.12.1.custom/jquery-ui.min.js");
Html.AppendScriptParts(ResourceLocation.Footer, "~/lib/jquery-validate/jquery.validate.unobtrusive-v3.2.10/jquery.validate.unobtrusive.min.js");
Html.AppendScriptParts(ResourceLocation.Footer, "~/lib/jquery-validate/jquery.validate-v1.17.0/jquery.validate.min.js");
Html.AppendScriptParts(ResourceLocation.Footer, "~/lib/jquery/jquery-3.3.1.min.js");
//X-UA-Compatible tag
if (commonSettings.RenderXuaCompatible)
{
Html.AppendHeadCustomParts($"<meta http-equiv=\"X-UA-Compatible\" content=\"{commonSettings.XuaCompatibleValue}\"/>");
}
//custom tag(s);
if (!string.IsNullOrEmpty(seoSettings.CustomHeadTags))
{
Html.AppendHeadCustomParts(seoSettings.CustomHeadTags);
}
var storeId = storeContext.CurrentStore.Id;
var themeColor = settingService.GetSettingByKey("venturethemesettings.themecolor", "dark-theme", storeId, true);
var currentPageClass = (await Html.PartialAsync("_CurrentPageClass")).ToHtmlString().Trim();
eventPublisher.Publish(new PageRenderingEvent(this.Html));
}
<!DOCTYPE html>
<html lang="@languageService.GetTwoLetterIsoLanguageName(workContext.WorkingLanguage)" @(this.ShouldUseRtlTheme() ? Html.Raw(" dir=\"rtl\"") : null) @Html.NopPageCssClasses()>
<head>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','XXXXXXXXXX');</script>
<!-- End Google Tag Manager -->
<title>@Html.NopTitle()</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<meta name="description" content="@(Html.NopMetaDescription())" />
<meta name="keywords" content="@(Html.NopMetaKeywords())" />
<meta name="generator" content="nopCommerce" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<link href="https://fonts.googleapis.com/css?family=Fjalla+One&subset=latin-ext&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato&subset=latin-ext&display=swap" rel="stylesheet">
@Html.NopHeadCustom()
@*This is used so that themes can inject content into the header*@
@await Html.PartialAsync("Head")
@await Component.InvokeAsync("Widget", new { widgetZone = PublicWidgetZones.HeadHtmlTag })
@await Component.InvokeAsync("Widget", new { widgetZone = "head_html_tag_after_css_files_venture" })
@Html.NopCssFiles(ResourceLocation.Head)
@Html.NopScripts(ResourceLocation.Head)
@Html.NopCanonicalUrls()
@await Component.InvokeAsync("NewsRssHeaderLink")
@await Component.InvokeAsync("BlogRssHeaderLink")
@*Insert favicon and app icons head code*@
@await Component.InvokeAsync("Favicon")
@if (displayMiniProfiler)
{
<mini-profiler />
}
@Html.NopInlineScripts(ResourceLocation.Head)
<!--Powered by nopCommerce - https://www.nopCommerce.com-->
</head>
<body class="@currentPageClass @themeColor">
<div class="page-loader">
<div class="loader"></div>
</div>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=XXXXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
@RenderBody()
@Html.NopCssFiles(ResourceLocation.Footer)
@Html.NopScripts(ResourceLocation.Footer)
@Html.NopInlineScripts(ResourceLocation.Footer)
<div class="scroll-back-button" id="goToTop"></div>
</body>
</html>