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:

Auto-closing of databases (was DON'T use old cart file!) (1997) carriage returns in data (1997) Cumulative Shipping charge calculations - your help please. (1997) Price characteristics? (1997) Add to Cart & List of Products (1997) rotating thumbnails (1997) [WebDNA] Problem with SendMail - seems succesfull but nothing to (2016) Re1000001: Setting up shop (1997) Country & Ship-to address & other fields ? (1997) View Source from cache (1997) Using [detete] (1998) Confirming a bug/oddity (2003) Protecting webdelivery (1997) Size limit for tmpl editor ? (1997) Auto Unsubscribe (2000) writing db to disk (1997) FREE Web Server Monitor FREE (1997) Re WebDNA has reached it connection limit (2004) b18 problem on NT 4.0 (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)