Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-10-2011, 04:49 PM   PM User | #1
AreYouAMac
New to the CF scene

 
Join Date: Jan 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
AreYouAMac is an unknown quantity at this point
Using AJAX to update multiple data

Hi guys,

I seem to have a problem with a code I am trying to write.

I have a Dummy Product (parent) product that has 3 Grouped Products (child) underneath it. I made a Parent Product page that shows all child products also.

The thing is, each child product has options (i.e. small, medium, large). I have one Add to Cart button. But when I click on it, only the last Child Product listed is added to the cart. I am trying to get all 3 child products and their options to be added to the cart via that one Add to Cart button.

Here is the snippet I made for it...

Code:
<a href="#" onclick="return $(this).getForm().sendRequest(
'shop:on_addToCart', {
onSuccess: function(){alert('The product has been added to your cart.')},
extraFields: {product_id: '<?= $grouped_product->id ?>'},
update: {'mini_cart': 'shop:mini_cart'}
});">Add to Cart</a>
Is there any way i can make ALL child products be added to the cart?

Thanks for any input.
AreYouAMac is offline   Reply With Quote
Old 02-11-2011, 09:36 AM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
If you've got a JS code issue, post the generated JS code, not the server-side code.

Also, we probably need to see your HTML structure.
Spudhead is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:36 AM.


Advertisement
Log in to turn off these ads.