Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

STS add to cart button


tec

Recommended Posts

hey there everyone, this may be a stupid question, but what the heck.

 

I have placed this code $addtocartbutton in my template, I assumed it would add items to the cart also, but when you click on the button, it doesnt do anything.

Any ideas?

Link to comment
Share on other sites

hey there everyone, this may be a stupid question, but what the heck.

 

I have placed this code $addtocartbutton in my template, I assumed it would add items to the cart also, but when you click on the button, it doesnt do anything.

Any ideas?

 

Probably not the best advice, but this is what I did:

 

<form name="cart_quantity" action="http://i-muffs.com/product_info.php?products_id=28&action=add_product" method="post">

<input type="hidden" name="products_id" value="28"><input type="image" src="images/orderButton.gif" border="0" alt="Order Now" title=" Order Now ">

</center>

</form>

 

I got this code from the product_info.php line for actually adding to cart. I'm sure you can change the product ID to fit whatever you want.

 

the cart im working on has only 1 product so it's easy that way.

 

one drawback that I think others might agree on is the lack of a osCid variable being passed in the link. I'm using STS as well and I haven't yet figured out how to go about this....if you know, please tell me. I know how to make a custom box if that helps.

Link to comment
Share on other sites

Probably not the best advice, but this is what I did:

 

<form name="cart_quantity" action="http://i-muffs.com/product_info.php?products_id=28&action=add_product" method="post">

<input type="hidden" name="products_id" value="28"><input type="image" src="images/orderButton.gif" border="0" alt="Order Now" title=" Order Now ">

</center>

</form>

 

I tried adding two of these forms to my product_info.php

like this ( i have 2 products)

<form name="cart_quantity" action="inmyspace.net/product_info.php?products_id=31&action=add_product" method="post">

<input type="hidden" name="products_id" value="31"><input type="image" src="images/orderButton.gif" border="0" alt="Order Now" title=" Order Now ">

</center>

</form>

<form name="cart_quantity" action="inmyspace.net/product_info.php?products_id=30&action=add_product" method="post">

<input type="hidden" name="products_id" value="30"><input type="image" src="images/orderButton.gif" border="0" alt="Order Now" title=" Order Now ">

</center>

</form>

 

the first one will add the item to the cart, the second one does not work

Link to comment
Share on other sites

I tried adding two of these forms to my product_info.php

like this ( i have 2 products)

<form name="cart_quantity" action="inmyspace.net/product_info.php?products_id=31&action=add_product" method="post">

<input type="hidden" name="products_id" value="31"><input type="image" src="images/orderButton.gif" border="0" alt="Order Now" title=" Order Now ">

</center>

</form>

<form name="cart_quantity" action="inmyspace.net/product_info.php?products_id=30&action=add_product" method="post">

<input type="hidden" name="products_id" value="30"><input type="image" src="images/orderButton.gif" border="0" alt="Order Now" title=" Order Now ">

</center>

</form>

 

the first one will add the item to the cart, the second one does not work

 

hmm, I really dont know...

 

What about the $startform and $endform elements that your supposed to use.

Link to comment
Share on other sites

  • 1 year later...
hmm, I really dont know...

 

What about the $startform and $endform elements that your supposed to use.

 

shaunklink - Thank you for your post! I was having the same problem with the $addtocartbutton not working. When I looked for the $startform element it was not there. Now that I have added that element it works.

 

Thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...