Re: [WebDNA] Apply discount using a line item

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106546
interpreted = N
texte = Hi Steve I have worked on a number of e-commerce systems over the years.. and = they were all special weird deals (none based on store builder).. and = the various gift-cert./discount codes were also all over the map.. but = several times I recall wishing that either I had started in the first = place with doing it the latter way you describe (make the discount a = negative lineitem, so I did not have to alter the math flow already in = place), or else wishing the system I inherited had been done that way. =20= To override a price of a lineitem you just set it as you work with it. = It's been so long my memory is hazy here.. but IIRC, you just do = something like: [SetLineItem = cart=3Dxxxx&index=3Dn&db=3Dcatalog.txt]quantity=3D4&textA=3DBlue&price=3D[= thisPrice]&password=3DyourPRICECHANGEpassword[/SetLineItem] from the old docs: http://docs.webdna.us/pages.html?context=3DSetLineItemContext.html (Optional) Sometimes you may need to change the price of a product after = it has already been added to the cart. Normally you use a formula to = vary pricing, but since formulas only apply if a product is first added = to the cart, this alternate technique may be needed. Remember to put the = line item change password (see above) into the parameters. Definitely ping me/us here again if you get stuck at any point.. as my = memory about all this will come back quickly if we troubleshoot any part = of this process out loud. -Govinda On 2011-04-19, at 8:10 AM, Steve Craig wrote: > Hi >=20 > I have a very old shopping site that was loosely based on a = sitebuilder template and my customer has requested an ability to give = users a 15% early order facility. Basically the site is for catering = requirements for exhibitions, so if a customer orders a certain amount = of time before the exhibition they get a discount. >=20 > I had started adding code to the totals bit but I'm wondering if it = would be easier to have a line item that was a discount item instead. = That would save me having to re-write a load of reports stuff at the = backend. >=20 > So thinking aloud I would get to the checkout, fill in the address = stuff, proceed to the invoice and in doing so automatically add a line = item with a negative amount. My question is, if I was doing this how can = I override the price of a lineitem as I add it to the cart as the = discount would obviously vary depending on the size of their order? >=20 > Or does anyone have any better ideas, I need a simple solution as they = are not wanting a bill for my time. >=20 > Thanks for any help. >=20 > Cheers > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Steve Craig - Asylum Interactive Ltd > Tel +44 1330 860550 Fax +44 1330 860880 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > http://www.asylumweb.com > Email: steve@asylumweb.com > Skype: s.craig - iChat: steve.craig > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 >=20 >=20 >=20 >=20 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us - Govinda -------------- Old WebDNA talklist archives: http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwebdna-talk Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Apply discount using a line item (Govinda 2011)
  2. Re: [WebDNA] Apply discount using a line item (Govinda 2011)
  3. Re: [WebDNA] Apply discount using a line item (Steve Craig 2011)
  4. Re: [WebDNA] Apply discount using a line item (Govinda 2011)
  5. [WebDNA] Apply discount using a line item (Steve Craig 2011)
Hi Steve I have worked on a number of e-commerce systems over the years.. and = they were all special weird deals (none based on store builder).. and = the various gift-cert./discount codes were also all over the map.. but = several times I recall wishing that either I had started in the first = place with doing it the latter way you describe (make the discount a = negative lineitem, so I did not have to alter the math flow already in = place), or else wishing the system I inherited had been done that way. =20= To override a price of a lineitem you just set it as you work with it. = It's been so long my memory is hazy here.. but IIRC, you just do = something like: [SetLineItem = cart=3Dxxxx&index=3Dn&db=3Dcatalog.txt]quantity=3D4&textA=3DBlue&price=3D[= thisPrice]&password=3DyourPRICECHANGEpassword[/SetLineItem] from the old docs: http://docs.webdna.us/pages.html?context=3DSetLineItemContext.html (Optional) Sometimes you may need to change the price of a product after = it has already been added to the cart. Normally you use a formula to = vary pricing, but since formulas only apply if a product is first added = to the cart, this alternate technique may be needed. Remember to put the = line item change password (see above) into the parameters. Definitely ping me/us here again if you get stuck at any point.. as my = memory about all this will come back quickly if we troubleshoot any part = of this process out loud. -Govinda On 2011-04-19, at 8:10 AM, Steve Craig wrote: > Hi >=20 > I have a very old shopping site that was loosely based on a = sitebuilder template and my customer has requested an ability to give = users a 15% early order facility. Basically the site is for catering = requirements for exhibitions, so if a customer orders a certain amount = of time before the exhibition they get a discount. >=20 > I had started adding code to the totals bit but I'm wondering if it = would be easier to have a line item that was a discount item instead. = That would save me having to re-write a load of reports stuff at the = backend. >=20 > So thinking aloud I would get to the checkout, fill in the address = stuff, proceed to the invoice and in doing so automatically add a line = item with a negative amount. My question is, if I was doing this how can = I override the price of a lineitem as I add it to the cart as the = discount would obviously vary depending on the size of their order? >=20 > Or does anyone have any better ideas, I need a simple solution as they = are not wanting a bill for my time. >=20 > Thanks for any help. >=20 > Cheers > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Steve Craig - Asylum Interactive Ltd > Tel +44 1330 860550 Fax +44 1330 860880 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > http://www.asylumweb.com > Email: steve@asylumweb.com > Skype: s.craig - iChat: steve.craig > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 >=20 >=20 >=20 >=20 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us - Govinda -------------- Old WebDNA talklist archives: http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwebdna-talk Govinda

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:

webcat- multiple selection in input field (1997) b12 cannot limit records returned and more. (1997) Why does this not work? (2002) Saving results of a multiple select (2002) Problems getting parameters passed into email. (1997) CyberCash problem in OS9/4.5 -> OSX/5.1 transition (2003) WebCatalog 2.0 & WebDNA docs in HTML ... (1997) service stop and restart (1997) WebCatalog for Postcards ? (1997) Multiple catalog databases and showcart (1997) [LOOKUP] (1997) too many nested tags ... (1997) Storebuilder Seems to have just died (2003) FYI: virus alert (1996) Encryption method used for [encrypt]? (2000) shipcost and Formulas.db (2000) Problem with date and ranges (2002) Document Contains No Data! (1997) WebCat2 - many [carts] on one template page? (1997) WebCat2.0 [format thousands .0f] no go (1997)