Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Using LinksSQL as a CNET like Compare Prices Engine

Quote Reply
Using LinksSQL as a CNET like Compare Prices Engine
Hello everyone,

I want to use LinksSQL so that I can create a compare prices section much like the one at cnet.com

How would I set it up so that I can have a bulk form for the merchants to fill out for each product in the database?

It would be murder to have to fill out a seperate form for each product.

Each merchant would have to be, in this case a link or resource, and the product being the category. Then I would be able to post multiple listings of merchants per product.

Any ideas?

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Using LinksSQL as a CNET like Compare Prices Engine In reply to
Ouch!

Prices change so often!

What you need to do is make a form pre-parser, and create separate groups of items in the form -- same tags, maybe with a numeric appended.

Then, in whatever cgi you are adding to, you need to make a new procedure to take the form input and put the variables into a hash of hashes for each group of entries (like the return value of a database query)

Then, you need to wrap the "guts" of the cgi into a foreach type loop, and iterate through each of the individual hashes.

You need to test for error conditions on each of the entries in the first loop, and send the data back to the form for correction if there is an error.

If you sit and think about it for awhile it probably will make sense.

You can use the same "vendor/merchant" info, and just have changed fields for each product, and re-use the entered data, or you could get fancy and use a check-box for "same as above" etc.

But, you need to send the data with the form, and you need to put it into the hash of hashes -- and then you won't have to change anything, except put the guts into the larger foreach loop.

Untested, but should work.

Quote Reply
Re: Using LinksSQL as a CNET like Compare Prices Engine In reply to
Hello PugDog,

You seem to have a grasp on things. Would you be for hire for such a project?

Let me know. I would need you to get the basic structure set up and I would take care of the rest.

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Using LinksSQL as a CNET like Compare Prices Engine In reply to
There is no way I could commit to a project like this -- I took my first consulting lunch in 9 months today... spent 3 hours on a 1 hour estimate ...., but as much as he tried to put on the table, all I could do is point him in the right direction... I just don't have enough time.... I need 3 more computers here just to let me have them do different things so I can just scoot from keyboard to keyboard -- switching windows causes too many problems and reboots ... <sigh>

Give a sample of the fields you want to use, or show me the sample form (just make a dummy form on your site somewhere) and I'll try to sketch out the code. The loop shouldn't be too hard, but it will take a lot of tweaking to get all the little things right -- I'm sure.

All it really is is taking the form input, and put it into a hash of hashes (so the code can access one "slice" of data at a time), then wrap the script in a loop so that the code thinks it's adding one record -- but you just loop until you run out of data (use up all the hashes) and then send the confirm or error, etc.

There might even be a simpler way to do it, but this seems like a "safe" hack because you'll be able to wrap any new version in the same code.

Quote Reply
Re: Using LinksSQL as a CNET like Compare Prices Engine In reply to
Ok heres the thing...

We would create the product database and the merchants that sign up with us would have to use our database of products.

They would come onto a bacend form and be able to enter the following information for each product on one bulk form:

- price
- shipping cost
- product url on their site
- in stock (amount or infinity)

I figure we would create the database so that each product would be a category and each merchant listed for that product would be a link or resource in that category.

I want to make the front end so that the user can sort by price or other fields as well.

Let me know what you think?


------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Using LinksSQL as a CNET like Compare Prices Engine In reply to
bump
Quote Reply
Re: Using LinksSQL as a CNET like Compare Prices Engine In reply to
Is this for the main links database?

Are these "updates" to existing links, or are they all new items?

Are these all registered merchants, who have agreed to a standard of behaviour, and are willing to put a bit of effort into their uploads? Meaning if they could upload a pipe-delimited flat-file that could be imported into the links database, would that solve your problem?

The reason is, with file-uploads, you can pre-authorize who can upload, then the system can parse the file, and if it passes a validity check, it can insert them into the database. It can do all this without using the web-based interface except for the file upload.

Is there an example of this on your system somewhere that shows what you are trying to do? I don't think I've grasped exactly what you are trying to do, although the "multiple entry" part I get <G> But I need to see what you are trying to do on your site to have it make sense.

But, if these are merchants or vendors trying to maintain a "current" status of their items, then the text upload/modify might be a better option all around. It would be faster, safer, and less prone to errors on either end.