[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Displaying multiple sku's
Kevin Walsh wrote:
>>I'm trying to figure out how I would go about creating something where I
>>could call ic like this:
>>http://www.domain.com/cgi-bin/ic?sku1=somesku&sku2=anothersku&sku3=yetanothersku
>>
>>And then have it display the results page only displaying the sku's that
>>I passed in the url. Is something like this possible?
>>
>>
> Anything is possible. :-)
>
> Try starting with a page that just lists the SKUs in a loop.
> Once you have that going, you can start to look up product
> information.
>
> A page that contains something like this will start you on
> your way:
>
> [calc]
> $CGI->{'sku'} =~ s/\0/ /g;
> undef;
> [/calc]
> [loop arg="[cgi sku]"]
> [loop-code] - [loop-description]<br>
> [/loop]
>
> That will take a URI like:
>
> pagename.html?sku=00-0010:sku=00-403:sku=98-101
>
>
> ...and will just show some SKU info, one SKU per line. You can
> use the various [loop-*] tags to display what you want, with no
> limit on the number of SKUs passed into the page.
>
> You could also modify the [calc] like this:
>
> [calc]
> $CGI->{'sku'} =~ s/,/ /g;
> undef;
> [/calc]
>
> That would do the same job, but your URI args would have to look
> like this instead:
>
> pagename.html?sku=00-0010,00-403,98-101
>
> (Comma-separated list in one URI arg.)
>
> Of course, you could modify it again to allow a combination of
> the above two methods, but I'll leave that as an exercise for the
> reader. :-)
>
>
Thanks, that will get me started.
Steven Potter