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:

Re:Running 2 two WebCatalog.acgi's (1996) forming a SKU (1999) b12 cannot limit records returned and more. (1997) Problems with [Applescript] (1997) can WC render sites out? (1997) dollar $ signs in database (2000) WebCat2b13MacPlugIn - [shownext method=post] ??? (1997) WebCat2 - [format thousands] (1997) Small problem (2001) $Replace with [founditems] (1997) Problems with Search between X and Y (1999) Cart questions (1997) Replacing a variable within a variable. (1998) Two stores, one server (1998) Tracking inbound links for discounts (1997) Crashing Server (2000) WebDNA Life Cycle (was Form POSTing with LONG variable) (2007) WCS Newbie question (1997) Bug Report, maybe (1997) Re:PCS Customer submissions ? (1997)