Re: Problems passing [SKU] with $Replace in 2.0

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 10907
interpreted = N
texte = Trevor, I'm trying to get a feel for what you're trying to do here so I can suggest alternatives that may work better. I can't quite tell yet, but I think maybe you're using $Replace in a way that it's not designed to work.>I have a $Replace command that generates a template where I am trying to >place the [SKU] field and it does not display in the template as the >actual number, but as [SKU] > >----------------------- >The replace code--> >----------------------- > >
> > > >
This doesn't do any replacing. Remember the $Replace command is all-in-one: it searches for qualified records and replaces in a single step. So in your example here it looks for all the SKUs that match, but there are no hidden fields that contain the new text for the fields you want to be changed. So let's assume you wanted to change the price: then you'd need to add another value such as:>----------------------- >The corresponding code in guidemodified.tmpl--> >----------------------- > >[Search db=/WebCatalog/jackson.db&eqSKUdata=[SKU]] >[FoundItems] >
>VALUE=/templates/[TemplateName]preview.tmpl> > > >The problem I see here is that you're coming to this template without specifying a SKU. The only two form values that you're passing thru from the previous form are named DB and eqSKUdata. You don't have a form variable named SKU, so naturally any [SKU] you put into the template will just remain unchanged: literally [SKU].I know it's easy to mentally assume that you've specified a SKU because you are thinking that eqSKUdata specifies it. But the name of that form variable is literally eqSKUdata, not SKU. You might try something like this:[Search db=/WebCatalog/jackson.db&eqSKUdata=[eqSKUdata]]It looks funny, but that's what the name of the form variable is.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court, #462 | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Associated Messages, from the most recent to the oldest:

    
  1. Re: Problems passing [SKU] with $Replace in 2.0 (Trevor Crist 1997)
  2. Re: Problems passing [SKU] with $Replace in 2.0 (Grant Hulbert 1997)
  3. Re: Problems passing [SKU] with $Replace in 2.0 (Kenneth Grome 1997)
  4. Problems passing [SKU] with $Replace in 2.0 (Trevor Crist 1997)
Trevor, I'm trying to get a feel for what you're trying to do here so I can suggest alternatives that may work better. I can't quite tell yet, but I think maybe you're using $Replace in a way that it's not designed to work.>I have a $Replace command that generates a template where I am trying to >place the [SKU] field and it does not display in the template as the >actual number, but as [SKU] > >----------------------- >The replace code--> >----------------------- > > > > > >
This doesn't do any replacing. Remember the $Replace command is all-in-one: it searches for qualified records and replaces in a single step. So in your example here it looks for all the SKUs that match, but there are no hidden fields that contain the new text for the fields you want to be changed. So let's assume you wanted to change the price: then you'd need to add another value such as:>----------------------- >The corresponding code in guidemodified.tmpl--> >----------------------- > >[Search db=/WebCatalog/jackson.db&eqSKUdata=[SKU]] >[founditems] >
>VALUE=/templates/[TemplateName]preview.tmpl> > > >The problem I see here is that you're coming to this template without specifying a SKU. The only two form values that you're passing thru from the previous form are named DB and eqSKUdata. You don't have a form variable named SKU, so naturally any [SKU] you put into the template will just remain unchanged: literally [SKU].I know it's easy to mentally assume that you've specified a SKU because you are thinking that eqSKUdata specifies it. But the name of that form variable is literally eqSKUdata, not SKU. You might try something like this:[Search db=/WebCatalog/jackson.db&eqSKUdata=[eqSKUdata]]It looks funny, but that's what the name of the form variable is.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court, #462 | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Grant Hulbert

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:

Multiple catalog databases and showcart (1997) [subtotal] and others (1997) Showif, Hideif reverse logic ? (1997) TeaRoom (2000) file upload type restrictions? (2001) WC2.0 Memory Requirements (1997) WebCatalog2 Feature Feedback (1996) [TaxableTotal] - not working with AOL and IE (1997) WebCat Hosting - Pricing Question (2002) [BoldWords] WebCat.acgib15Mac (1997) [WebDNA] [OT] BBEdit Glossary (2012) WebCatalog Eating 200% of the CPU (2002) searchable list archive (1997) Plugin or CGI or both (1997) [WebDNA] was: Two file tags don't work as expected: Now: Permission Settings (2009) Frames and [cart] (1998) forms and variables (1998) listfiles shows invisible files ... (1999) Custom Error Pages - what I've done (1998) serial number dishing (1997)