Esempio n. 1
0
        /// <summary>
        /// Returns all the pricingvariants
        /// </summary>
        public static XPathNavigator GetAllPricingVariants()
        {
            var pricingVariantList = DomainHelper.GetAllProductVariants().ToList();

            var stream1 = new MemoryStream();

            //Serialize the Record object to a memory stream using DataContractSerializer.
            var serializer = new DataContractSerializer(typeof(List <ProductVariant>), "PricingVariants", "");

            serializer.WriteObject(stream1, pricingVariantList);
            stream1.Position = 0;

            var result = new StreamReader(stream1).ReadToEnd();

            var doc = new XmlDocument();

            doc.LoadXml(result);


            return(doc.CreateNavigator());
        }
Esempio n. 2
0
 /// <summary>
 /// Gets all product variants.
 /// </summary>
 /// <param name="storeAlias">The store alias.</param>
 /// <param name="currencyCode">The currency code.</param>
 /// <returns></returns>
 public static IEnumerable <IProductVariant> GetAllProductVariants(string storeAlias = null, string currencyCode = null)
 {
     return(DomainHelper.GetAllProductVariants(false, storeAlias, currencyCode).Select(v => new VariantAdaptor(v)));
 }
Esempio n. 3
0
 /// <summary>
 /// Returns all the pricingvariants for the given store or current store
 /// </summary>
 /// <param name="storeAlias">The store alias.</param>
 /// <returns></returns>
 public static List <ProductVariant> GetAllVariants(string storeAlias = null)
 {
     return(DomainHelper.GetAllProductVariants(false, storeAlias).Where(x => x.Product.Categories.Any()).ToList());
 }