Exemple #1
0
        /// <summary>
        /// Creates the Url for a catalog item by Id
        /// </summary>
        /// <param name="id">catalog item Id</param>
        /// <param name="categoryId">the Id of the category used to build the url. input 0 will use currentCategory.</param>
        /// <param name="storeId">the id of the store you want to link to</param>
        /// If the categoryId is not in the categories list of the product, it will use the first category
        /// <returns></returns>
        public static string NiceUrl(int id, int categoryId, int storeId)
        {
            var store = StoreHelper.GetById(storeId);

            return(store != null?StoreHelper.GetNiceUrl(id, categoryId, store.Alias) : StoreHelper.GetNiceUrl(id, categoryId));
        }