I am pretty new to EPiServer, MVC and .NET so I would appreciate if you could specify all the steps when answering.
I have currently I fresh install of EPiServer 7 and EPiServer Commerce. I have already created 1 catalog named "Results" with 3 products "Product 1", "Product 2" and "Product 3" and I would like to know how to access those products within my source code.
I have read the documentation but it didn't really helped me so far so I would really appreciate if you could provide me the necessary lines of code to get access to the EPiServer Commerce instance in order to get the instances of the products.
Thank you in advance for your valuable help!!
Mediachase.Commerce.Catalog.CatalogContext is the main class to remember when working with catalog entries, nodes and catalogs.
CatalogContext.Current gets the current instance of the catalog system, and using this instance you can retrieve the entries (or the catalog) that you mention.
The basic usage to retrieve a catalog entry:
var catalogEntry = CatalogContext.Current.GetCatalogEntry("Product1Code");
Where Product1Code is the identifier assigned by you upon creation in the manager (or via the API). You can also use the database autoincremented id to retrieve objects (an overload for GetCatalogEntry).
You should read Roger Cevungs articles to get a better insight, starting with http://world.episerver.com/Articles/Items/Catalog-Entry-loading-and-ResponseGroups-in-EPiServer-Commerce/.