Re: Some Advise needed

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 12486
interpreted = N
texte = >I am working on a project that has some products that will need to either >have seperate prices depending on what size of the product is purchased or >maybe a base + additional charge would work. > >For example you have a bottle of gear lube that comes in 4 oz., 8 oz. and >12 oz. sizes, with prices of $4.00, $7.00 and $10.00.The simplest approach (but maybe not the prettiest) is to pretend like all those variations are different products in your database. So when people search for lube, they see 3 different SKUs, 3 different prices, and 3 different descriptions.But if you truly want to make them look like 'variations' of a single product, you can do some more work like the following:Assuming that not all products will have exactly 3 variations, your best bet is to use a related database that contains the variations, using a sku that is similar so you can find the variations easily. For simplicity, you could use the related database even for products that have no variations, just to keep the WebDNA consistent.You'll also need to make a special formula for price, so WebCatalog can figure out which alternate price product you're referring to in the cart.-- catalog.db -- SKU Title Taxable Lube Gear Lube T Wax Seat Wax T-- Variations.db -- SKU SubType Description Price Lube 1 4 oz. 4.00 Lube 2 8 oz. 7.00 Lube 3 12 oz. 10.00 Wax 1 Vanilla 9.00 Wax 2 Cinnamon 9.00So you would do all your searches in the main catalog.db, and for each found item you would do a search thru the Variations.db to find the prices and descriptions.[FoundItems] [SKU], [Title] <-- Main product shows here [search db=Variations.db&eqSKUdata=[SKU]] [FoundItems] [SubType], [Description], [Price] <-- list variations here Add [/FoundItems] [/search] [/FoundItems]For pricing, you would have to search for the SKU+SubType in the variations database to get the correct price for that particular product.-- Formulas.db -- price [search db=Variations.db&eqSKUdatarq=[sku]&eqSubTypedatarq=[SubType]][FoundItems][price][/FoundItems][/search]I have not tested this (it comes off the top of my head), but it's the general idea.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Associated Messages, from the most recent to the oldest:

    
  1. Re: Some Advise needed (Grant Hulbert 1997)
  2. Re: Some Advise needed (Richard Wylie 1997)
  3. Re: Some Advise needed (Grant Hulbert 1997)
  4. Some Advise needed (Britt T. 1997)
>I am working on a project that has some products that will need to either >have seperate prices depending on what size of the product is purchased or >maybe a base + additional charge would work. > >For example you have a bottle of gear lube that comes in 4 oz., 8 oz. and >12 oz. sizes, with prices of $4.00, $7.00 and $10.00.The simplest approach (but maybe not the prettiest) is to pretend like all those variations are different products in your database. So when people search for lube, they see 3 different SKUs, 3 different prices, and 3 different descriptions.But if you truly want to make them look like 'variations' of a single product, you can do some more work like the following:Assuming that not all products will have exactly 3 variations, your best bet is to use a related database that contains the variations, using a sku that is similar so you can find the variations easily. For simplicity, you could use the related database even for products that have no variations, just to keep the WebDNA consistent.You'll also need to make a special formula for price, so WebCatalog can figure out which alternate price product you're referring to in the cart.-- catalog.db -- SKU Title Taxable Lube Gear Lube T Wax Seat Wax T-- Variations.db -- SKU SubType Description Price Lube 1 4 oz. 4.00 Lube 2 8 oz. 7.00 Lube 3 12 oz. 10.00 Wax 1 Vanilla 9.00 Wax 2 Cinnamon 9.00So you would do all your searches in the main catalog.db, and for each found item you would do a search thru the Variations.db to find the prices and descriptions.[founditems] [SKU], [Title] <-- Main product shows here [search db=Variations.db&eqSKUdata=[SKU]] [founditems] [SubType], [Description], [Price] <-- list variations here Add [/FoundItems] [/search] [/FoundItems]For pricing, you would have to search for the SKU+SubType in the variations database to get the correct price for that particular product.-- formulas.db -- price [search db=Variations.db&eqSKUdatarq=[sku]&eqSubTypedatarq=[SubType]][founditems][price][/FoundItems][/search]I have not tested this (it comes off the top of my head), but it's the general idea.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Grant Hulbert

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Multiple prices (1997) File dates in WebCatalog .tmpl/.inc (1997) searching multiple databases in single search (1997) WebCat2 - [format thousands] (1997) [WebDNA] How to get a screen size (2009) creating a ShipCosts database (1997) WebCatalog 2.0 b 15 mac (1997) Search bug. Help (2002) Math Problem - Format? (1997) ftp to webstar (2001) More on the email templates (1997) Help name our technology! (1997) WC 4.0 on OSX 10.0.4 problems (2001) bannerads example idiot (1997) You can't buy something twice... (1997) DataBaseHelper Flawed (1997) question: Eudora 3.1.1 (1997) Resume Catalog ? (1997) SV: WebCat on Linux (2000) quantity minimum problem (1997)