Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

shopping cart CGI call

Posted on 2000-03-11
4
Medium Priority
?
628 Views
Last Modified: 2013-12-25
I am working on a shopping cart app for a clothing company.  I need to let customers indicate size and color of the product they choose.  The products all have SKU's assigned, and I have the CGI call to add the item to the cart.  My question is this:  I was going to use a pull down menu with the size and color choices presented.  I tried using a standard javascript pull down that looked like this:

<form name="formname">
              <select name="selectName" size="1">
                <option value=""> --Select size/color--</option>
                <option value="http://www.myshop.com/olshop/cart.cgi?add=052SW">Small/white</option>

However, this did not work.  It would pull up another window, which I really don't want it to do, and it did not add the item to the cart.    Basically, that is the CGI call above.  I need to add some type of selection system to the pages to let the customer choose size and color.  The built in stuff on this particular shopping cart is not acceptable for the end result I am trying to achieve, but I have to use this cart.  I can do it with images using the following:

<a HREF="http://www.myshop.com/olshop/cart.cgi?add=052SW"><img src="anyimage.gif" width="18" height="20" border="0"></a>

This works just fine, although since it is an HREF, it redirects you to the "view cart" page.  I would like to avoid the redirect, and simply post the selection to the "cart" 'behind the scenes' so to speak without redirecting the shopper.  

The relevant calls are below:

"To use the shopping cart and ordering features of the online shop you don't have to use the default pages - product list, categories and product search. You can directly use some of the CGI's:

/olshop/product.cgi?id=xxxx - this link will display the product with ID xxxx.

/olshop/cart.cgi?add=xxxx - this link will add the product with ID xxxx to the
     shopping cart, and will display the shopping cart contents.

/olshop/cart.cgi - this link will display the shopping cart contents.

/olshop/orderinfo.cgi - this link will proceed to the ordering form.

For example, if you want customers to add the product 1234 to their shopping cart by clicking on the product picture somewhere on your web site you can use the following HTML code:

     <A HREF="/olshop/cart.cgi?add=1234"><IMG SRC="product.gif"><A>

I don't profess to know what the heck I am doing with this type of setup, so any help/ other suggestions would be appreciated, thank you in advance!!!
0
Comment
Question by:mmoline
  • 3
4 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 3000 total points
ID: 2608131
you can use javascript code to achieve what you want.

"....I was going to use a pull down menu with the size and color choices presented......"

this is totally fine. But what i dont understand is why you dont want to submit the form using CGI, either as a POST method or via GET method??

using CGI with any of the above methods you can easily get what you want!!

Eg.

<form method=GET action="/cgi-bin/my_script.cgi">

<select name="add" size="1">
  <option value=""> --Select size/color--</option>
  <option value="052SW">Small/white</option>
  <option value="060XB">XL/black</option>
</select>

<input type=img src="some_image.gif">
</form>

Now if the user were to click on the image your request would be sent to the CGI script.

However if you dont want a CGI script to be invoked for each and every user action, you might want to consider using cookies with javascript.

i have some websites that offer FREE PERL code for shopping carts. (PERL since i develop using it :) )

they will give you a very good working example, WITH the source code!!

http://www.arpanet.com/perlshop/
http://www.freeperlcode.com/guide/jump.cgi?ID=286
http://www.lecart.com/download.xsp
http://www.freeperlcode.com/guide/jump.cgi?ID=90
http://www.freeperlcode.com/guide/jump.cgi?ID=590
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2608132
you can use javascript code to achieve what you want.

"....I was going to use a pull down menu with the size and color choices presented......"

this is totally fine. But what i dont understand is why you dont want to submit the form using CGI, either as a POST method or via GET method??

using CGI with any of the above methods you can easily get what you want!!

Eg.

<form method=GET action="/cgi-bin/my_script.cgi">

<select name="add" size="1">
  <option value=""> --Select size/color--</option>
  <option value="052SW">Small/white</option>
  <option value="060XB">XL/black</option>
</select>

<input type=img src="some_image.gif">
</form>

Now if the user were to click on the image your request would be sent to the CGI script.

However if you dont want a CGI script to be invoked for each and every user action, you might want to consider using cookies with javascript.

i have some websites that offer FREE PERL code for shopping carts. (PERL since i develop using it :) )

they will give you a very good working example, WITH the source code!!

http://www.arpanet.com/perlshop/
http://www.freeperlcode.com/guide/jump.cgi?ID=286
http://www.lecart.com/download.xsp
http://www.freeperlcode.com/guide/jump.cgi?ID=90
http://www.freeperlcode.com/guide/jump.cgi?ID=590
0
 

Author Comment

by:mmoline
ID: 2612651
Thank you Manesh....I know it was a simple one, I promise to challenge you more in the future!!
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2612685
Glad to have helped you.

looking forward to more challenging ones :-)

Rgds
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How important is it to take extra precautions to protect your online business? These are some steps you can take to make sure you're free of any cyber crime.
Learn about the eCommerce marketing trends for the year ahead.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question