Forums / General Questions / Link that add product to cart and go checkout?

Link that add product to cart and go checkout?

Locked

Started by ronwong on 17 Mar 2007, 4:51 PM · Views: 2,711

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
17 Mar 2007, 4:51 PM
#1
ronwong avatar

ronwong

Zen Follower

Join Date:
Jan 2006
Posts:
223
Plugin Contributions:
0

Link that add product to cart and go checkout?

I am thinking about this for sometime. Is there any way to do some sort of Buy-It-Now? Lets say in an external site, you put an advertisement or say some postings for Product A at $1 (go and get it now), the viewer clicks the link or the button, and is directed to the zencart, with a product already added to shopping cart and lands on the shopping cart page or the checkout page..?

Rather than after they click the link, the go to the main page, then they search for product A, then add to cart before going check out. That helps to clinch sales.

17 Mar 2007, 5:17 PM
#3
virtualahmad avatar

virtualahmad

Zen Follower

Join Date:
Jan 2006
Location:
Toronto, Ontario, Canada
Posts:
179
Plugin Contributions:
0

Re: Link that add product to cart and go checkout?

if so....

<body>
<form name="cart_quantity" action="http://www.onlineshop.com.sg/index.php?main_page=product_info&products_id=3032&action=add_product" method="post" enctype="multipart/form-data">

<input type="text" name="cart_quantity" value="1" maxlength="6" size="4" />
<br /><br />
<input type="hidden" name="products_id" value="3032" /><input type="image" src="http://www.onlineshop.com.sg/includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" title=" Add to Cart " />

</form>
</body>

NOTES:

  • All the links in the code MUST include the HTTP://domainname....
  • if you don't want the qty box to show up, then change
<input type="text" name="cart_quantity" value="1" maxlength="6" size="4" />

to

<input type="hidden" name="cart_quantity" value="1" maxlength="6" size="4" />
  • you can also preset the qty by changing the "VALUE=1" in the line above, hidden or not
  • you MUST change the "VALUE=3032" to the product_id of the product you want to be adding to the cart. This value can be seen in the admin in the left column when viewing list of products.

Hope this helps !

Ahmad Rahman
TRUST IT | web site design and development
mobile: 416.828.0224 | email: [email protected]
www.trustit.ca

For IT solutions how you want IT, when you want IT, TRUST IT.

19 Mar 2007, 1:49 PM
#4
ronwong avatar

ronwong

Zen Follower

Join Date:
Jan 2006
Posts:
223
Plugin Contributions:
0

Re: Link that add product to cart and go checkout?

YES! that is lovely. This really will help sales by taking some steps off for the customers. You know people nowadays, attention span is really short!

16 Apr 2007, 4:41 PM
#5
ronwong avatar

ronwong

Zen Follower

Join Date:
Jan 2006
Posts:
223
Plugin Contributions:
0

Re: Link that add product to cart and go checkout?

Would the above be able be done in php code? You know? forum, sometimes they disable html...

16 Apr 2007, 5:08 PM
#6
virtualahmad avatar

virtualahmad

Zen Follower

Join Date:
Jan 2006
Location:
Toronto, Ontario, Canada
Posts:
179
Plugin Contributions:
0

Re: Link that add product to cart and go checkout?

yes... as regular html code, you can use the link in the following format:

http://www.domain.com/index.php?main_page=index&action=buy_now&products_id=1641

where 1641 in this case is the product id.

Ahmad Rahman
TRUST IT | web site design and development
mobile: 416.828.0224 | email: [email protected]
www.trustit.ca

For IT solutions how you want IT, when you want IT, TRUST IT.

17 Apr 2007, 8:54 AM
#7
ronwong avatar

ronwong

Zen Follower

Join Date:
Jan 2006
Posts:
223
Plugin Contributions:
0

Re: Link that add product to cart and go checkout?

virtualahmad:

yes... as regular html code, you can use the link in the following format:

http://www.domain.com/index.php?main_page=index&action=buy_now&products_id=1641

where 1641 in this case is the product id.

Let me try this. so its just like a link in the php, let me see if it work.. you are a ZEN GOD!

26 Oct 2007, 2:19 AM
#8
incredibody_com avatar

incredibody_com

New Zenner

Join Date:
May 2007
Posts:
42
Plugin Contributions:
0

Re: Link that add product to cart and go checkout?

This does work out well except I need to link to a product with attributes attached to it. Is it possible to add a product with an attribute to the cart in this same manner?

26 Oct 2007, 2:27 AM
#9
incredibody_com avatar

incredibody_com

New Zenner

Join Date:
May 2007
Posts:
42
Plugin Contributions:
0

Re: Link that add product to cart and go checkout?

I was able to get it working. Below is what I did with the changes in bold:

<body>
<form name="cart_quantity" action="http://www.onlineshop.com.sg/index.php?main_page=product_info&products_id=3032&action=add_product" method="post" enctype="multipart/form-data">

[B]<input type="hidden" name="id[20]" value="258" id="attrib-20-258" />[/B]

<input type="text" name="cart_quantity" value="1" maxlength="6" size="4" />
<br /><br />
<input type="hidden" name="products_id" value="3032" /><input type="image" src="http://www.onlineshop.com.sg/includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" title=" Add to Cart " />

</form>
</body>

I pulled out that code by doing a view source in the internet brower and getting that information in the Attributes Module Section of the attribute I wanted to link to.