Re: Shopping Cart w/Multiple Databases

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 20672
interpreted = N
texte = >I am utilizing two different databases with different field names for the >same info (i.e. one database has the field artist while the other has >artistName. I would like to be able to search either database and add >products from each to the same shopping cart. How do I set up the shopping >cart to display info properly in each field.First, a little theory of operation: when you add something to the cart, WebCatalog needs to know which db you're adding from so it can do 2 things --1) get the price/unitShipCost/taxable/canEmail information and store it in the lineitem portion of the shopping cart file 2) display other fields from your db when asked to (inside the [LineItems] loop)The way WebCatalog knows how to do this is by using your db and SKU to perform a lookup for all this information. This works easily as long as you only use one db, because there's no question as to where it should look. Basically, when you put some simple WebDNA like [price] or [CustomDBField] inside a [LineItems] loop, WebCatalog silently performs a [Lookup db=xx...etc] to find the field value. If WebCatalog didn't do this for you, you'd have to manually type all those [Lookup] things every place you wanted to display a field value.So....the solution in your case is to manually insert a [Lookup] when you need to display fields. Your only problem will be knowing which db to look in, so I suggest that when you Add a product to the shopping cart, you also set one of the lineitem variables (such as textA or textB) to be the name of the db. You only need to use the custom lookup for fields that are *not* already stored in the lineitem fields. That way, your lookup can look like this:[LineItems] [price], [unitShipCost], [Lookup db=[textA]&lookInField=sku&value=[sku]&returnField=otherFieldName] [/lineitems]Notice you don't need the lookup for variables that are already available in the lineitems. You can see a complete list of these variables in the docs under File Formats/Order File (or, not surprisingly, in the [LineItems] context section)Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Shopping Cart w/Multiple Databases (PCS Technical Support 1998)
  2. Re: Shopping Cart w/Multiple Databases (PCS Technical Support 1998)
  3. Shopping Cart w/Multiple Databases (Allan G. Restrepo 1998)
>I am utilizing two different databases with different field names for the >same info (i.e. one database has the field artist while the other has >artistName. I would like to be able to search either database and add >products from each to the same shopping cart. How do I set up the shopping >cart to display info properly in each field.First, a little theory of operation: when you add something to the cart, WebCatalog needs to know which db you're adding from so it can do 2 things --1) get the price/unitShipCost/taxable/canEmail information and store it in the lineitem portion of the shopping cart file 2) display other fields from your db when asked to (inside the [lineitems] loop)The way WebCatalog knows how to do this is by using your db and SKU to perform a lookup for all this information. This works easily as long as you only use one db, because there's no question as to where it should look. Basically, when you put some simple WebDNA like [price] or [CustomDBField] inside a [lineitems] loop, WebCatalog silently performs a [Lookup db=xx...etc] to find the field value. If WebCatalog didn't do this for you, you'd have to manually type all those [lookup] things every place you wanted to display a field value.So....the solution in your case is to manually insert a [lookup] when you need to display fields. Your only problem will be knowing which db to look in, so I suggest that when you Add a product to the shopping cart, you also set one of the lineitem variables (such as textA or textB) to be the name of the db. You only need to use the custom lookup for fields that are *not* already stored in the lineitem fields. That way, your lookup can look like this:[lineitems] [price], [unitShipCost], [Lookup db=[textA]&lookInField=sku&value=[sku]&returnField=otherFieldName] [/lineitems]Notice you don't need the lookup for variables that are already available in the lineitems. You can see a complete list of these variables in the docs under File Formats/order file (or, not surprisingly, in the [lineitems] context section)Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ PCS Technical Support

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:

[GREP] Why is the dash invalid? (2002) Google Web Accelerator (2005) [trim]?! (2004) PCS Frames (1997) Bugs? What Bugs? was:Spawning Holdup? (2000) Protect folder (2005) Serious bug writing to a database ... (2002) Web Catalog 2 demo (1997) [DOS]/DOS query perhaps OT (2003) SERIAL NUMBER BEING LOST AGAIN!!! (1999) Still can't interpret encrypted templates. (2003) Different Tax levels (1998) WebCat2 as a chat server? (1997) [WebDNA] passing a variable in an include - precedence (2015) Am I going senile? (Price recalc based on quantity) (1997) Plain Language Manual? (1998) [addlineitems] (1997) Add to a field (1998) Running 2 two WebCatalog.acgi's (1996) UPDATE - WebDNA - UNIX Shell program request (2004)