The basic content included in the standard version of nopCommerce provides a comprehensive shopping experience for most site users. However, there are times when it’s desirable to include dynamic content in an existing page of the site. We’ll cover how to embed a topic in an existing page of your nopCommerce-driven website.
We’ll start with the prerequisite that you’re working with a development environment that includes the nopCommerce project and Visual Studio. Under the Presentation/Nop.Web project, navigate to the Views folder. For this example, we’ll choose the file “details.cshtml”, under the “Order” folder.
Let’s say we’d like to be able to add special offers and promos for customers to see when viewing their order details. First, we’ll create a topic in the nopCommerce Administration/Content Management/Topics. Let’s make the system name “DetailsPromo”, so that we can remember this for later.
Now let’s go back to details.cshtml; in the div with the class of “order-details”, we’ll add this line:
@Html.Action("TopicBlock", "Topic", new { systemName = "DetailsPromo" })
Now, we can include content via the administration section of the site; thus, we can include a “Thanks for shopping with us” offer, or a notice that due to weather conditions, all shipping will be delayed by X, or any other information that might be relevant to share with our customers. Pretty slick, huh?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Looking for quality nopCommerce Hosting? Look no further than Arvixe Web Hosting!