Post by DefconRhall » Sat Dec 08, 2012 3:38 pm

I have a product selection page, where a customer fills out a form, such as number of people and the page suggests the products that would work for the customer.

What I want is to be able to have the customer click a button or a link to add the item to their cart from there.

However I can't find any documentation on how to do this with just a simple link.
I have looked at posts that talked about previous versions using a link or a form submit, but those do not seem to work with 1.5.4 they just send you to the shopping cart page which is empty.

I took the common.js and put it on the product selection page, and use the addToCart function which works... if they have already been to the store. I tried putting an iframe on the page that was hidden going to the cart page, and that partly works, but fails on iphone/ios devices.

Is there any direct way to do this without jumping through a bunch of hoops, and if not does anyone know why the ios devices would not use the function?

The button code is as follows:

Code: Select all

onclick="addToCart('120',$('#frmfield').val()); document.location='/shop/index.php?route=checkout/cart';"
The product id does exist, and the frmfield is different for each product suggested.

New member

Posts

Joined
Thu Aug 30, 2012 11:00 am

Post by imsir » Wed Feb 13, 2013 12:35 am

Have the same problem, did you manage to find a solution for this?

New member

Posts

Joined
Tue Jan 29, 2013 12:20 am

Post by DefconRhall » Wed Feb 13, 2013 5:09 am

imsir wrote:Have the same problem, did you manage to find a solution for this?
There is no simple solution here, what I mentioned got the job done, just not on IOS devices...

To fix this I had to actually make a seperate php page and put it in the root of my site and link over to it.

What it does is create a new cart and add the quantity of the item ID specified to the cart, then redirect to the cart checkout page.

New member

Posts

Joined
Thu Aug 30, 2012 11:00 am
Who is online

Users browsing this forum: No registered users and 61 guests