close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

add to cart multiples of 2

Thread began 6/29/2016 11:42 am by Jamie | Last modified 6/29/2016 7:09 pm by Ray Borduin | 108 views | 6 replies |

Jamie

add to cart multiples of 2

Hey Ray

Am trying to get the cart working on that site we discussed the other night - the one where I have a matrix of products and needed to set it up so they could add other items that didnt fall into the matrix.

Have got the 2nd table set up and the backend working fine.

I have the add to cart on the front end 'working' with a couple of probs.

If you add an item to cart on the book-now.php (http://goo.gl/DbREYH) page you then get taken to cart.php - so far so good

Now that you're on the cart.php page, if you add the top item to cart (http://prntscr.com/bmmyps) for some reason it adds 2 items (and multiples of 2 every time you add to cart) to the cart for that line.....

Problem 2.

Clear the cart on the above page. You should still be on cart.php but the original matrix is showing. Add an item to cart there it is adding the item in multiples of 2 and no product name (http://prntscr.com/bmmzz4) - not sure whats happening there - and if you then try to add the extra item (http://prntscr.com/bmn0f2) it adds it (with the product name but again adds in quantities of multiples of 2......

have attached the cart.php and book-now.php pages if it helps

Thanks

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

You have the add to cart code on the page twice. Lines 109-136 and again on lines 180-207. Remove the first one and it won't add twice.

Sign in to reply to this post

Jamie

ok thanks. thats working fine but now the 'non matrix' item although is being added once, is not showing the product name - http://prntscr.com/bmqwk0

Sign in to reply to this post

Ray BorduinWebAssist

It looks like you are looping on the ProductMisc table, but inserting from the EB1 table. My guess is that the query isn't returning the results you expect. Try running that query in phpMyAdmin to make sure your joins are correct and that the value for ProductNames and ProductTypeName are what you expect.

Sign in to reply to this post

Jamie

OK, but when you helped me with the matrix side of things, you set up the EB1 recordset....I get that its using one table (products) and I have added a new one to accommodate the 'other' ptoduct items (products2) but not sure how to incorporate wihtout using a secon atc which clearly doesnt work.....

Sign in to reply to this post

Ray BorduinWebAssist

You could use a second add to cart if you have two add to cart buttons.... just make sure your add to cart buttons have a unique name and the triggers are unique.

I think I advised you on setting up the alternate items but never worked on it with you. I'm getting a bit confused at this point as to what you are trying to do and what is and isn't needed. Maybe you do need two add to carts, but then they need to use different button names. Or did you want two items added to the cart with a single button press?

If the correct products are getting added but just have the wrong name then that would imply just an issue with your SQL statement.

Sign in to reply to this post

Jamie

EDIT - have actually got it workign now mate

Thanks for getting me on track

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...