Re: !@#$$@@# formulas database, tax and freight.

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 43053
interpreted = N
texte = No, webcat is able to add straight to the Cart as soon as I created it on my site.I simply used:[addlineitem cart=[cart]&db=admin/products.db&sku=[url][sku-to-be-added][/url]]quantity=[ qty]&[formvariables name=__&exact=F]Text[lookup db=admin/categories.db&lookinfield=C_ID&value=[getchars start=3][name][/getchars]&returnfield=C_CART]=[url][value][/url]&[/formvaria bles][/addlineitem]So it is not a problem adding immediately after creation.I am not certain how your tax and freight are being added, but there is a header in the cart called taxable. Any product you wish to add tax to needs to set the taxable header to T (taxable=T).Perhaps I can see your formula from the Database so I can see what you are trying to add.Though one way we did change the price was to set a variable prior to adding the line item using a lookup.[text]thePrice=[LOOKUP db=Formulas.db&value=price&lookInField=Name&returnField=Formula¬Found=Tex tIfNotFound][/text] [AddLineItem cart=[cart]&sku=[the-sku-to-be-added]&db=^products.db]SKU=[the-sku-to-be-add ed]&quantity=[qty]&price=[thePrice]&password=[lookup db=WebCatalog Prefs&lookinfield=preference&value=LineItemChangePassword&returnfield=value] [/addlineitem]Let me know if I can assist. I also would be willing to look directly at the code to assist if you like. Just contact me off-list.------------------------------------------------------------ Ronald Kirkland - President Inkblot Media - Internet Solutions Experts Phone: 949.400.4456 * FAX: 949.654.0269 Visit: http://www.inkblotmedia.com Email: ron@inkblotmedia.com ----------------------------------------------------------------- Original Message ----- From: Andrew Simpson To: WebCatalog Talk Sent: Sunday, September 01, 2002 10:35 PM Subject: Re: !@#$$@@# formulas database, tax and freight. > ignore Alain - he's suffering a bit today from a complete lack knowing what > he's talking about. > > the reason i didn't do it that way was because for a reasonably high traffic > site, it wouldn't make much sense to keep all the carts for each visitor. We > have set webcat to sweep the carts directory every 24 hours. In saying that > however, i do check to see if the old cart is still there and if it is, > transfer the contents into the new cart. > > regardless - this is still not the problem. > > maybe webcat has issues with things being added to a cart a fraction of a > second after the cart was created? > > > > ----- Original Message ----- > From: Alain Russell > To: WebCatalog Talk > Sent: Monday, September 02, 2002 4:40 PM > Subject: Re: !@#$$@@# formulas database, tax and freight. > > > > That would make far to much sense for Andrew ;) > > > > > > > Why not just set the cart number into the cookie and when the person > returns > > > to the site use a getcookie to set the cart #. > > > > > > This is how we make sites remember the users. > > > > > > > > > > > > > > > ----- Original Message ----- > > > From: Andrew Simpson > > > To: WebCatalog Talk > > > Sent: Sunday, September 01, 2002 5:00 PM > > > Subject: Re: !@#$$@@# formulas database, tax and freight. > > > > > > > > >> yeah - I went through all this malarky the first time I coded the > store. > > >> > > >> I ended up putting taxable = T in the formulas database and that is > meant > > > to > > >> overide everything. > > >> > > >> You can't set taxable in the addlineitem unless you supply the password > as > > >> it is similar to changing the price of the items in the cart. we > weren't > > > too > > >> keen on the idea of supplying the password. > > >> > > >> anyway - taxable and freight is picked up alright by the first code and > > > not > > >> by the second and I still fail to see the difference and why one would > act > > >> differently to another. > > >> > > >> > > >> > > >> ----- Original Message ----- > > >> From: Stuart Tremain > > >> To: WebCatalog Talk > > >> Sent: Monday, September 02, 2002 11:46 AM > > >> Subject: Re: !@#$$@@# formulas database, tax and freight. > > >> > > >> > > >>> I had the same problem recently. > > >>> > > >>> It may be that you also need to pass a password in the addlineitems: > > >>> > > >>> > > >>> [LineItems][AddLineItem > > >> > > > > file=repeatorders/[cart]&sku=[sku]&db=../data/directproducts.db]password=You > > >> > > > > rPassword&Quantity=[Quantity]&Taxable=[Taxable]&TextA=[TextA]&TextB=[TextB]& > > >> TextC=[TextC]&TextD=[TextD]&TextE=[TextE][/AddLineItem] [/LineItems] > > >>> > > >>> The password is in wour webcat prefs. > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> -- > > >>> Stuart Tremain > > >>> idfk web developments - Australia > > >>> > > >>> On Monday, 2 September 2002, Andrew Simpson > > >> wrote: > > >>>> A site we did is trying to be clever in that it remembers what you > had > > > in > > >>>> your cart from visit to visit. > > >>>> > > >>>> If you add something to your cart then close your browser, open your > > >> browser > > >>>> and come back again. the item is magically restored. > > >>>> > > >>>> The way it works is i store a temporary customer ID in a cookie and > > > write > > >>>> the products to a database. If the customer comes back i loop through > > > all > > >>>> the products in the database and add them back in to a new > > >>>> cart. > > >>>> > > >>>> My problem however is that when i add the products programatically, > the > > >> tax > > >>>> and freight from the formulas database are ignored. > > >>>> > > >>>> What i can't understand is the code that adds the line item the first > > >> time > > >>>> around is identical to the code the re-adds the products from > > >>>> the database. > > >>>> > > >>>> What am i missing? > > >>>> > > >>>> Do i have to set some headers before or after i add line items to > > > invoke > > >> the > > >>>> formulas database? > > >>>> Do i have to use setlineitems rather than addlineitems? > > >>>> do i have to do a rain dance to make this mickey mouse technology > work > > >> the > > >>>> way i expect everytime??? > > >>>> > > >>>> code that adds line item and works correctly: > > >>>> [!]***Everything okay?***[/!] > > >>>> [showif [add_a_lineYN]=YES] > > >>>> [text]price_error_msg=Sorry, we do not currently have a price for > > > that > > >>>> product. You are welcome to call and find out more about its > > >>>> availability.[/text] > > >>>> [text]show_price_error=YES[/text] > > >>>> [hideif [LOOKUP > > >>> > > >> > > >> > db=/db/products.db&value=[SKU]&lookInField=SKU&returnField=PRICE¬Found=] > > >> = > > >>>> ] > > >>>> [text]show_price_error=NO[/text] > > >>>> [AddLineItem > > >>>> cart=[newcart]&sku=[sku]&db=/db/products.db]quantity=1[/AddLineItem] > > >>>> [/hideif] > > >>>> [/showif] > > >>>> > > >>>> code that re-adds line item and doesn't work. > > >>>> [!]*** Order can exist under either the customer ID if the user has a > > >>>> profile or under the cart as an order ID ***[/!] > > >>>> [!]*** If they are a logged in user - do it this way as there may > > > be > > >>>> more than one order under this cust_id and it would be good to clear > it > > >> all > > >>>> up ***[/!] > > >>>> [showif [user_logged_in]=TRUE] > > >>>> [search > > >>>> db=/db/existing_order.db&eqCUST_IDdatarq=[logged_user_id]&max=1] > > >>>> [founditems] > > >>>> [search > > >>> > > >> > > >> > db=/db/existing_detail.db&eqEXISTING_IDdatarq=[EXISTING_ID]&asLINE_IDsort=1 > > >> & > > >>>> LINE_IDtype=number] > > >>>> [founditems] > > >>>> [AddLineItem > > >>> > > >> > cart=[newcart]&sku=[PROD_SKU]&db=/db/products.db]quantity=1[/AddLineItem] > > >>>> [/founditems] > > >>>> [/search] > > >>>> [/founditems] > > >>>> [/search] > > >>>> [/showif] > > >>>> > > >>>> help? > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> ------------------------------------------------------------- > > >>>> This message is sent to you because you are subscribed to > > >>>> the mailing list . > > >>>> To unsubscribe, E-mail to: > > >>>> To switch to the DIGEST mode, E-mail to > > >> > > >>>> Web Archive of this list is at: http://search.smithmicro.com/ > > >>>> > > >>> > > >>> > > >>> > > >>> ------------------------------------------------------------- > > >>> This message is sent to you because you are subscribed to > > >>> the mailing list . > > >>> To unsubscribe, E-mail to: > > >>> To switch to the DIGEST mode, E-mail to > > >> > > >>> Web Archive of this list is at: http://search.smithmicro.com/ > > >> > > >> > > >> ------------------------------------------------------------- > > >> This message is sent to you because you are subscribed to > > >> the mailing list . > > >> To unsubscribe, E-mail to: > > >> To switch to the DIGEST mode, E-mail to > > > > > >> Web Archive of this list is at: http://search.smithmicro.com/ > > > > > > > > > ------------------------------------------------------------- > > > This message is sent to you because you are subscribed to > > > the mailing list . > > > To unsubscribe, E-mail to: > > > To switch to the DIGEST mode, E-mail to > > > > > > Web Archive of this list is at: http://search.smithmicro.com/ > > > > > > ------------------------------------------------------------- > > This message is sent to you because you are subscribed to > > the mailing list . > > To unsubscribe, E-mail to: > > To switch to the DIGEST mode, E-mail to > > > Web Archive of this list is at: http://search.smithmicro.com/ > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > Web Archive of this list is at: http://search.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: !@#$$@@# formulas database, tax and freight. (Donovan Brooke 2002)
  2. Re: !@#$$@@# formulas database, tax and freight. (Inkblot Media 2002)
  3. Re: !@#$$@@# formulas database, tax and freight. (Andrew Simpson 2002)
  4. Re: !@#$$@@# formulas database, tax and freight. (Inkblot Media 2002)
  5. Re: !@#$$@@# formulas database, tax and freight. (Alain Russell 2002)
  6. Re: !@#$$@@# formulas database, tax and freight. (Andrew Simpson 2002)
  7. Re: !@#$$@@# formulas database, tax and freight. (Stuart Tremain 2002)
  8. !@#$$@@# formulas database, tax and freight. (Andrew Simpson 2002)
No, webcat is able to add straight to the Cart as soon as I created it on my site.I simply used:[addlineitem cart=[cart]&db=admin/products.db&sku=[url][sku-to-be-added][/url]]quantity=[ qty]&[formvariables name=__&exact=F]Text[lookup db=admin/categories.db&lookinfield=C_ID&value=[getchars start=3][name][/getchars]&returnfield=C_CART]=[url][value][/url]&[/formvaria bles][/addlineitem]So it is not a problem adding immediately after creation.I am not certain how your tax and freight are being added, but there is a header in the cart called taxable. Any product you wish to add tax to needs to set the taxable header to T (taxable=T).Perhaps I can see your formula from the Database so I can see what you are trying to add.Though one way we did change the price was to set a variable prior to adding the line item using a lookup.[text]thePrice=[LOOKUP db=formulas.db&value=price&lookInField=Name&returnField=Formula¬Found=Tex tIfNotFound][/text] [AddLineItem cart=[cart]&sku=[the-sku-to-be-added]&db=^products.db]SKU=[the-sku-to-be-add ed]&quantity=[qty]&price=[thePrice]&password=[lookup db=WebCatalog Prefs&lookinfield=preference&value=LineItemChangePassword&returnfield=value] [/addlineitem]Let me know if I can assist. I also would be willing to look directly at the code to assist if you like. Just contact me off-list.------------------------------------------------------------ Ronald Kirkland - President Inkblot Media - Internet Solutions Experts Phone: 949.400.4456 * FAX: 949.654.0269 Visit: http://www.inkblotmedia.com Email: ron@inkblotmedia.com ----------------------------------------------------------------- Original Message ----- From: Andrew Simpson To: WebCatalog Talk Sent: Sunday, September 01, 2002 10:35 PM Subject: Re: !@#$$@@# formulas database, tax and freight. > ignore Alain - he's suffering a bit today from a complete lack knowing what > he's talking about. > > the reason i didn't do it that way was because for a reasonably high traffic > site, it wouldn't make much sense to keep all the carts for each visitor. We > have set webcat to sweep the carts directory every 24 hours. In saying that > however, i do check to see if the old cart is still there and if it is, > transfer the contents into the new cart. > > regardless - this is still not the problem. > > maybe webcat has issues with things being added to a cart a fraction of a > second after the cart was created? > > > > ----- Original Message ----- > From: Alain Russell > To: WebCatalog Talk > Sent: Monday, September 02, 2002 4:40 PM > Subject: Re: !@#$$@@# formulas database, tax and freight. > > > > That would make far to much sense for Andrew ;) > > > > > > > Why not just set the cart number into the cookie and when the person > returns > > > to the site use a getcookie to set the cart #. > > > > > > This is how we make sites remember the users. > > > > > > > > > > > > > > > ----- Original Message ----- > > > From: Andrew Simpson > > > To: WebCatalog Talk > > > Sent: Sunday, September 01, 2002 5:00 PM > > > Subject: Re: !@#$$@@# formulas database, tax and freight. > > > > > > > > >> yeah - I went through all this malarky the first time I coded the > store. > > >> > > >> I ended up putting taxable = T in the formulas database and that is > meant > > > to > > >> overide everything. > > >> > > >> You can't set taxable in the addlineitem unless you supply the password > as > > >> it is similar to changing the price of the items in the cart. we > weren't > > > too > > >> keen on the idea of supplying the password. > > >> > > >> anyway - taxable and freight is picked up alright by the first code and > > > not > > >> by the second and I still fail to see the difference and why one would > act > > >> differently to another. > > >> > > >> > > >> > > >> ----- Original Message ----- > > >> From: Stuart Tremain > > >> To: WebCatalog Talk > > >> Sent: Monday, September 02, 2002 11:46 AM > > >> Subject: Re: !@#$$@@# formulas database, tax and freight. > > >> > > >> > > >>> I had the same problem recently. > > >>> > > >>> It may be that you also need to pass a password in the addlineitems: > > >>> > > >>> > > >>> [lineitems][AddLineItem > > >> > > > > file=repeatorders/[cart]&sku=[sku]&db=../data/directproducts.db]password=You > > >> > > > > rPassword&Quantity=[Quantity]&Taxable=[Taxable]&TextA=[TextA]&TextB=[TextB]& > > >> TextC=[TextC]&TextD=[TextD]&TextE=[TextE][/AddLineItem] [/LineItems] > > >>> > > >>> The password is in wour webcat prefs. > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> -- > > >>> Stuart Tremain > > >>> idfk web developments - Australia > > >>> > > >>> On Monday, 2 September 2002, Andrew Simpson > > >> wrote: > > >>>> A site we did is trying to be clever in that it remembers what you > had > > > in > > >>>> your cart from visit to visit. > > >>>> > > >>>> If you add something to your cart then close your browser, open your > > >> browser > > >>>> and come back again. the item is magically restored. > > >>>> > > >>>> The way it works is i store a temporary customer ID in a cookie and > > > write > > >>>> the products to a database. If the customer comes back i loop through > > > all > > >>>> the products in the database and add them back in to a new > > >>>> cart. > > >>>> > > >>>> My problem however is that when i add the products programatically, > the > > >> tax > > >>>> and freight from the formulas database are ignored. > > >>>> > > >>>> What i can't understand is the code that adds the line item the first > > >> time > > >>>> around is identical to the code the re-adds the products from > > >>>> the database. > > >>>> > > >>>> What am i missing? > > >>>> > > >>>> Do i have to set some headers before or after i add line items to > > > invoke > > >> the > > >>>> formulas database? > > >>>> Do i have to use setlineitems rather than addlineitems? > > >>>> do i have to do a rain dance to make this mickey mouse technology > work > > >> the > > >>>> way i expect everytime??? > > >>>> > > >>>> code that adds line item and works correctly: > > >>>> [!]***Everything okay?***[/!] > > >>>> [showif [add_a_lineYN]=YES] > > >>>> [text]price_error_msg=Sorry, we do not currently have a price for > > > that > > >>>> product. You are welcome to call and find out more about its > > >>>> availability.[/text] > > >>>> [text]show_price_error=YES[/text] > > >>>> [hideif [LOOKUP > > >>> > > >> > > >> > db=/db/products.db&value=[SKU]&lookInField=SKU&returnField=PRICE¬Found=] > > >> = > > >>>> ] > > >>>> [text]show_price_error=NO[/text] > > >>>> [AddLineItem > > >>>> cart=[newcart]&sku=[sku]&db=/db/products.db]quantity=1[/AddLineItem] > > >>>> [/hideif] > > >>>> [/showif] > > >>>> > > >>>> code that re-adds line item and doesn't work. > > >>>> [!]*** Order can exist under either the customer ID if the user has a > > >>>> profile or under the cart as an order ID ***[/!] > > >>>> [!]*** If they are a logged in user - do it this way as there may > > > be > > >>>> more than one order under this cust_id and it would be good to clear > it > > >> all > > >>>> up ***[/!] > > >>>> [showif [user_logged_in]=TRUE] > > >>>> [search > > >>>> db=/db/existing_order.db&eqCUST_IDdatarq=[logged_user_id]&max=1] > > >>>> [founditems] > > >>>> [search > > >>> > > >> > > >> > db=/db/existing_detail.db&eqEXISTING_IDdatarq=[EXISTING_ID]&asLINE_IDsort=1 > > >> & > > >>>> LINE_IDtype=number] > > >>>> [founditems] > > >>>> [AddLineItem > > >>> > > >> > cart=[newcart]&sku=[PROD_SKU]&db=/db/products.db]quantity=1[/AddLineItem] > > >>>> [/founditems] > > >>>> [/search] > > >>>> [/founditems] > > >>>> [/search] > > >>>> [/showif] > > >>>> > > >>>> help? > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> ------------------------------------------------------------- > > >>>> This message is sent to you because you are subscribed to > > >>>> the mailing list . > > >>>> To unsubscribe, E-mail to: > > >>>> To switch to the DIGEST mode, E-mail to > > >> > > >>>> Web Archive of this list is at: http://search.smithmicro.com/ > > >>>> > > >>> > > >>> > > >>> > > >>> ------------------------------------------------------------- > > >>> This message is sent to you because you are subscribed to > > >>> the mailing list . > > >>> To unsubscribe, E-mail to: > > >>> To switch to the DIGEST mode, E-mail to > > >> > > >>> Web Archive of this list is at: http://search.smithmicro.com/ > > >> > > >> > > >> ------------------------------------------------------------- > > >> This message is sent to you because you are subscribed to > > >> the mailing list . > > >> To unsubscribe, E-mail to: > > >> To switch to the DIGEST mode, E-mail to > > > > > >> Web Archive of this list is at: http://search.smithmicro.com/ > > > > > > > > > ------------------------------------------------------------- > > > This message is sent to you because you are subscribed to > > > the mailing list . > > > To unsubscribe, E-mail to: > > > To switch to the DIGEST mode, E-mail to > > > > > > Web Archive of this list is at: http://search.smithmicro.com/ > > > > > > ------------------------------------------------------------- > > This message is sent to you because you are subscribed to > > the mailing list . > > To unsubscribe, E-mail to: > > To switch to the DIGEST mode, E-mail to > > > Web Archive of this list is at: http://search.smithmicro.com/ > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > Web Archive of this list is at: http://search.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Inkblot Media

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:

[BoldWords] WebCat.acgib15Mac (1997) Forbidden CGI Error (1997) WebCat editing, SiteGuard WAS:SiteAssociative lookup style? (1997) WC TableGrinder (1997) CASTEGORIES IN DIFFERENT FRAMES (1997) How to best sort in a pre-defined item-by-item order ... (2003) [quantity] within formulas (1997) How far do [showif]s go? (1997) [random] only for 1-100??? (1997) Dates and Math - Simple Subtraction (2004) [WebDNA] multi hyperlinks in text paragraphs (2014) Searching multiple fields from one form field (1997) Where is the bug fix info for 4.0.1? (2000) Problems getting parameters passed into email. (1997) slightly OT: advertising schemes (2004) thankyou.tmpl (1997) [Sum] function? (1997) GuestBook example (1997) suggestion (1997) Re:Emailer and encryption (1997)