Recently on the nopCommerce user forums, a developer sought to understand how to implement a popup site-wide for users visiting the site for the first time. Various industries can make use of this; sites that provide adult novelty products, wishing to confirm age, or any site that wants to remind site visitors of the benefits of registering with the site. nopCommerce team member haydie offered a clever solution; re-use the code for the EU cookie pop-up that’s currently implemented in nopCommerce. Let’s take a look at how that would work.
You’ll find the relevant source code in Nop.Web/Views/Common/EuCookieLaw.cshtml, and Nop.Web/Views/Common/EuCookieLaw.Mobile.cshtml.
We can see that the titles “EUCookieLaw.Description” and “Common.Show”, and the topic “privacyinfo” comprise the content that’s displayed to the site users; let’s log into our nopCommerce instance, and access that information. Edit the topic and titles to reflect the message you want to show your site visitors.
Now under Configuration/Settings/General and Miscellaneous Settings, check “Display EU cookie law warning: “, and click “Save”. Restart your application, and visit your site in a new browser window. You’ll now see your new pop-up displayed – simple, and very effective!