Jump to content

Adding Items To Cart - Outside of Cubecart.


Guest

Recommended Posts

I want to be able to add items to my shopping cart outside of cubecart actually on my website using AJAX.

I've tried posting to the cart page using jQuery $.post() like so:

$j.post("/cubecart/index.php?act=viewProd", { add: productID, quan: 1});

It appears to post and it gets the resulting page, but doesn't actually add it to the cart. Are there other variables I must pass to the page in order to get a product successfully added to the cart, or do I need to create a new posting page entirely?

Cheers :pirate:

Link to comment
Share on other sites

There is a remote buy mod at cubecartforums.org that should do this for you. Not sure thru ajax (I have no idea what ajax is truthfully), but the mod should do the trick.

Link to comment
Share on other sites

I've done this simply by adding a FORM to my outside pages which add a product to the cart.

You can see an example at http://www.KeysToPower.com. View Source, and scroll to the bottom. Or just search for "<form", which will take you straight there. As you'll see, I even include options.

Although I'm currently using CC4, the only thing different from the CC3 version is the URL. Also, in CC3, I installed a mod which took the customer directly to the View Cart page after placing an item in the cart, and that worked perfectly with the outside HTML FORM.

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.

Guest
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...