Пример #1
0
        private Product CreateCupCake()
        {
            var p = new Product();

            p.Sku                         = "SAMPLE002";
            p.ProductName                 = "Cup Cake Sample";
            p.Featured                    = true;
            p.IsSearchable                = true;
            p.ImageFileSmall              = "CupCake.jpg";
            p.ImageFileMedium             = "CupCake.jpg";
            p.ImageFileSmallAlternateText = "Cup Cake Sample SAMPLE002";
            p.InventoryMode               = ProductInventoryMode.AlwayInStock;
            p.LongDescription             =
                "Savor this sweet treat from our famous collection of sample items. This product is not for sale and is a demonstration of how items could appear in your store";
            p.MetaDescription = "Vanilla Cup Cake with Rich Frosting";
            p.MetaKeywords    = "cup,cake,cupcake,valentine,small,treats,baked goods";
            p.MetaTitle       = "Vanilla Cup Cake with Rich Frosting";
            p.SitePrice       = 1.99m;
            p.Status          = ProductStatus.Active;
            p.UrlSlug         = "cup-cake-sample";
            CatalogServices.ProductsCreateWithInventory(p, true);

            DiskStorage.CopyDemoProductImage(p.StoreId, p.Bvin, p.ImageFileSmall);

            return(p);
        }
Пример #2
0
        private Product CreateShirt()
        {
            var p = new Product();

            p.Sku                         = "SAMPLE003";
            p.ProductName                 = "Purple Top";
            p.Featured                    = true;
            p.IsSearchable                = true;
            p.ImageFileSmall              = "PurpleTop.jpg";
            p.ImageFileMedium             = "PurpleTop.jpg";
            p.ImageFileSmallAlternateText = "Purple Top SAMPLE003";
            p.InventoryMode               = ProductInventoryMode.AlwayInStock;
            p.LongDescription             =
                "This sample purple top is made of 100% cotton and is made in the USA. Durable and easy to clean, this versatile top will be one of the best sample items not available for purchase you've ever seen!";
            p.MetaTitle = "Purple Top";
            p.SitePrice = 39.95m;
            p.Status    = ProductStatus.Active;
            p.UrlSlug   = "purple-top";
            CatalogServices.ProductsCreateWithInventory(p, true);

            var opt1 = Option.Factory(OptionTypes.DropDownList);

            opt1.IsShared     = false;
            opt1.IsVariant    = true;
            opt1.Name         = "Size";
            opt1.NameIsHidden = false;
            CatalogServices.ProductOptions.Create(opt1);
            opt1.AddItem("Small");
            opt1.AddItem("Medium");
            opt1.AddItem("Large");
            CatalogServices.ProductOptions.Update(opt1);
            CatalogServices.ProductsAddOption(p, opt1.Bvin);

            var opt2 = Option.Factory(OptionTypes.DropDownList);

            opt2.IsShared     = false;
            opt2.IsVariant    = true;
            opt2.Name         = "Sleeve Length";
            opt2.NameIsHidden = false;
            CatalogServices.ProductOptions.Create(opt2);
            opt2.AddItem("Short");
            opt2.AddItem("Long");
            CatalogServices.ProductOptions.Update(opt2);
            CatalogServices.ProductsAddOption(p, opt2.Bvin);

            int possibleCount;

            CatalogServices.VariantsGenerateAllPossible(p, out possibleCount);

            DiskStorage.CopyDemoProductImage(p.StoreId, p.Bvin, p.ImageFileSmall);

            return(p);
        }
Пример #3
0
        private Product CreateBlueBracelet()
        {
            var p = new Product();

            p.Sku                         = "SAMPLE001";
            p.ProductName                 = "Blue Bracelet";
            p.Featured                    = true;
            p.IsSearchable                = true;
            p.ImageFileSmall              = "BraceletBlue.png";
            p.ImageFileMedium             = "BraceletBlue.png";
            p.ImageFileSmallAlternateText = "Blue Bracelet SAMPLE001";
            p.InventoryMode               = ProductInventoryMode.AlwayInStock;
            p.Keywords                    = "bracelett";
            p.ListPrice                   = 0;
            p.LongDescription             =
                "An incredible blue bracelet sample product. This item is not actually for sale. It is a sample product to demonstrate how your store may look with products loaded";
            p.MetaDescription = "Sample Blue Bracelet for Demonstration";
            p.MetaKeywords    = "Blue,Bracelet,Sample,Demo";
            p.MetaTitle       = "Sample Blue Bracelet";
            p.SitePrice       = 42.95m;
            p.Status          = ProductStatus.Active;
            p.UrlSlug         = "blue-bracelet";
            p.Tabs.Add(new ProductDescriptionTab
            {
                TabTitle = "Sustainability",
                HtmlData =
                    "<p>All of our jewelry products are recycled and made in sustainable eco-friendly environments</p>"
            });
            CatalogServices.ProductsCreateWithInventory(p, true);

            DiskStorage.CopyDemoProductImage(p.StoreId, p.Bvin, p.ImageFileSmall);

            // Create Review
            var review = new ProductReview();

            review.Approved    = true;
            review.Description =
                "This is a great bracelet. I would recommend it to anyone who appreciates sample products. Easy to wear!";
            review.ProductBvin = p.Bvin;
            review.Rating      = ProductReviewRating.FourStars;
            CatalogServices.ProductReviews.Create(review);

            return(p);
        }
Пример #4
0
        private Product CreateButterflyEarings()
        {
            var p = new Product();

            p.Sku                         = "SAMPLE006";
            p.ProductName                 = "Butterfly Earings";
            p.Featured                    = true;
            p.IsSearchable                = true;
            p.ImageFileSmall              = "Earrings.jpg";
            p.ImageFileMedium             = "Earrings.jpg";
            p.ImageFileSmallAlternateText = "Butterfly Earning SAMPLE006";
            p.InventoryMode               = ProductInventoryMode.AlwayInStock;
            p.LongDescription             =
                "Sample Butterfly Earings Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum";
            p.SitePrice = 29.95m;
            p.Status    = ProductStatus.Active;
            p.UrlSlug   = "butterfly-earings";
            CatalogServices.ProductsCreateWithInventory(p, true);

            DiskStorage.CopyDemoProductImage(p.StoreId, p.Bvin, p.ImageFileSmall);

            return(p);
        }
Пример #5
0
        private Product CreateLaptop()
        {
            var p = new Product();

            p.Sku                         = "SAMPLE005";
            p.ProductName                 = "Laptop Computer Sample";
            p.Featured                    = true;
            p.IsSearchable                = true;
            p.ImageFileSmall              = "Laptop.png";
            p.ImageFileMedium             = "Laptop.png";
            p.ImageFileSmallAlternateText = "Laptop Computer Sample SAMPLE005";
            p.InventoryMode               = ProductInventoryMode.AlwayInStock;
            p.LongDescription             =
                "This is a sample laptop computer. It is not for sale and is a demonstration of what products could look like in your store";
            p.MetaTitle = "Laptop Sample";
            p.ListPrice = 1999.00m;
            p.SitePrice = 1299.00m;
            p.Status    = ProductStatus.Active;
            p.UrlSlug   = "laptop-computer-sample";
            CatalogServices.ProductsCreateWithInventory(p, true);

            var opt1 = Option.Factory(OptionTypes.DropDownList);

            opt1.IsShared     = false;
            opt1.IsVariant    = true;
            opt1.Name         = "Screen Size";
            opt1.NameIsHidden = false;
            CatalogServices.ProductOptions.Create(opt1);
            opt1.AddItem("15 inch LCD");
            opt1.AddItem("17 inch LCD");
            CatalogServices.ProductOptions.Update(opt1);
            CatalogServices.ProductsAddOption(p, opt1.Bvin);

            var opt2 = Option.Factory(OptionTypes.RadioButtonList);

            opt2.IsShared     = false;
            opt2.IsVariant    = true;
            opt2.Name         = "Memory (RAM)";
            opt2.NameIsHidden = false;
            CatalogServices.ProductOptions.Create(opt2);
            opt2.AddItem("2GB");
            opt2.AddItem("4GB");
            opt2.AddItem("8GB");
            CatalogServices.ProductOptions.Update(opt2);
            CatalogServices.ProductsAddOption(p, opt2.Bvin);

            var opt3 = Option.Factory(OptionTypes.CheckBoxes);

            opt3.IsShared     = false;
            opt3.IsVariant    = false;
            opt3.Name         = "Warranty";
            opt3.NameIsHidden = false;
            CatalogServices.ProductOptions.Create(opt3);
            opt3.AddItem(new OptionItem {
                Name = "3 Year Extended Warranty [+$199]", PriceAdjustment = 199
            });
            CatalogServices.ProductOptions.Update(opt3);
            CatalogServices.ProductsAddOption(p, opt3.Bvin);

            int possibleCount;

            CatalogServices.VariantsGenerateAllPossible(p, out possibleCount);

            DiskStorage.CopyDemoProductImage(p.StoreId, p.Bvin, p.ImageFileSmall);

            return(p);
        }