Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Thanked 0 Times in 0 Posts

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

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

  2. #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    London, UK
    Thanked 110 Times in 109 Posts
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts