We understand that your ecommerce site is crucial to the success of your business, from time to time issues and questions can arise and you need to have the assurance there will be someone on hand to help resolve these in a timely fashion so you can spend your time driving your own business forward.

So if you are looking for faster responses to your questions or would like the assurance there is someone on hand for you to contact, fear not we have a number of paid support options that are available to you that can give your organisation the peace of mind knowing a member from the Cart Viper team will always be available to assist!

Purchase a Support Plan

Community Support

HomeHomeIssues and Supp...Issues and Supp...Templates & UITemplates & UIRazor MenuRazor Menu
Previous
 
Next
New Post
4/1/2014 5:00 AM
 

Hi Team,

A question from one of our team re. razor menus:

"I'm working with the Razorscript CV Menu and I'd like to know if there is any documentation available regarding the Cart Viper script helpers and libraries. 

In particular I'd like to know how to access a Categories parent ID using the CatalogNavigation class. 

I've done a search of the forum, blog and google but can't find any kind of documentation covering the specific Cart Viper libraries."

p.s the new razor menus are a great addition!

Cheers,

Charles

 
New Post
4/1/2014 10:02 AM
 

Hi Charles

Good question!

At the moment we have little to zero documentation. Let me try and help you out with some pointers here.

1. The CatalogNavigation object is used to work out the current request from the url of the page. So this allows you to see what category, product, search terms etc are supplied.

2. The variable cats holds all the categories within the system.

3. If we have a category in CatalogNavigation we could use some LINQ to work out if its got a parent category and what that parent category would be.

var currentCat = allCats.Where(c => c.CategoryID == catNav.CategoryID).FirstOrDefault();

if(currentCat != null && currentCat.ParentCategoryID > 0){
   var parentCategory = allCats.Where(c => c.CategoryID == currentCat.ParentCategoryID).FirstOrDefault();
}

That should then get you the parent category of the current category the customer has requested to view.

You could just write an extension method in Visual Studio and then reference that namespace in the Razor script if you want to get intellisence while coding up the method.

Another tip is to use Just Decompile or similar to have a look at our objects and methods. The main DLL would be CartViper.Modules.Store.dll and the namespace would be the Catalog one which contains the objects and controllers for the product and category data.

I hope this gives you a help. I know its a bit overwhelming without documentation but that is something we can try to improve.

Regards

Mark

 

 

 
Previous
 
Next
HomeHomeIssues and Supp...Issues and Supp...Templates & UITemplates & UIRazor MenuRazor Menu


 

We use cookies on our website to improve our service to you, by continuing you agree to our use of cookies. However you are able to update your settings at any time.

Cookie Policy

A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is a piece of data stored by a website within a browser, and then subsequently sent back to the same website by the browser. Cookies were designed to be a reliable mechanism for websites to remember things that a browser had done there in the past, which can include having clicked particular buttons, logging in, or having read pages on that site months or years ago.

Strictly Necessary Cookies

These cookies cannot be disabled

These cookies are necessary for the website to function and cannot be switched off. They are normally set in response to your interactions on the website e.g. logging in etc.

Cookies:
  • .ASPXANONYMOUS
  • .DOTNETNUKE
  • __RequestVerificationToken
  • authentication
  • CV_Portal
  • CV_Store_Portal_Cart_0
  • CV_USER
  • dnn_IsMobile
  • language
  • LastPageId
  • NADevGDPRCookieConsent_portal_0
  • userBrowsingCookie

Performance Cookies

These cookies allow us to monitor traffic to our website so we can improve the performance and content of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited or how you navigated around our website.

Cookies:
  • _ga
  • _gat
  • _gid

Functional Cookies

These cookies enable the website to provide enhanced functionality and content. They may be set by the website or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.

Cookies:

Currently we are not utilizing these types of cookies on our site.

Targeting Cookies

These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.

Cookies:

Currently we are not utilizing these types of cookies on our site.

Feedback