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 inthe lineitem portion of the shopping cart file2) 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 toperform a lookup for all this information. This works easily as long asyou only use one db, because there's no question as to where it shouldlook. 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 thisfor you, you'd have to manually type all those [Lookup] things every placeyou wanted to display a field value.So....the solution in your case is to manually insert a [Lookup] when youneed to display fields. Your only problem will be knowing which db to lookin, so I suggest that when you Add a product to the shopping cart, you alsoset one of the lineitem variables (such as textA or textB) to be the nameof 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 canlook like this:[LineItems][price], [unitShipCost], [Lookupdb=[textA]&lookInField=sku&value=[sku]&returnField=otherFieldName][/lineitems]Notice you don't need the lookup for variables that are already availablein the lineitems. You can see a complete list of these variables in thedocs 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 | Typhoon619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/
Associated Messages, from the most recent to the oldest:
>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 inthe lineitem portion of the shopping cart file2) 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 toperform a lookup for all this information. This works easily as long asyou only use one db, because there's no question as to where it shouldlook. 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 thisfor you, you'd have to manually type all those
[lookup] things every placeyou wanted to display a field value.So....the solution in your case is to manually insert a
[lookup] when youneed to display fields. Your only problem will be knowing which db to lookin, so I suggest that when you Add a product to the shopping cart, you alsoset one of the lineitem variables (such as textA or textB) to be the nameof 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 canlook like this:
[lineitems][price], [unitShipCost], [Lookupdb=[textA]&lookInField=sku&value=[sku]&returnField=otherFieldName][/lineitems]Notice you don't need the lookup for variables that are already availablein the lineitems. You can see a complete list of these variables in thedocs 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 | Typhoon619/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)