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:

Loosing Quantity (2000) Emailer again & again (1997) searching illegal HTML (2002) sorting and grouping (1998) Where is f2? (1997) [ShowIf] and empty fields (1997) Enhancement Request for WebCatalog-NT (1996) Banner Ad example (Typhoon) and WebCatalog (1997) [date format] w/in sendmail (1997) Reversed words (1997) WebCat2b13MacPlugIn - [shownext method=post] ??? (1997) searching by part of the date information (1999) Erotic Sites (1997) [WebDNA] New Webdna framework ! ... (addresses some initial concerns... (2012) WC Database Format (1997) WebCat2b13MacPlugin - nested [xxx] contexts (1997) Languages (1997) Date problems (1997) Version f1 status (1997) WebCatalog dying in NT (1998)