0

Is anyone running EE 2.8.1 and Cartthrob 2.5 getting the multi_add_to_cart_form to work? It seems to not be posting the values into the cart. I have gotten the one item add_to_cart_form to work and can see cart entries perfectly when using that tag, but the multi_add_to_cart shows nothing when attempting to view the cart. Here is my barebones hardcoded attempt template code:

{exp:cartthrob:multi_add_to_cart_form return="shopping_cart"}
     <input type="hidden" name="entry_id[1]" value="105" />
     <input type="hidden" name="entry_id[2]" value="103" />
     <input type="hidden" name="entry_id[3]" value="101" />
     <input type="submit" value="submit" />
{/exp:cartthrob:multi_add_to_cart_form}

I've also tried using the multi_add_to_cart_form nested in a {exp:channel:entries} tag pair, but it also does not seem to be posting the entries into the cart:

{exp:cartthrob:multi_add_to_cart_form return="shopping_cart"}
     {exp:channel:entries channel="products" status="Open"}
          <input type="hidden" name="entry_id[{count}]" value="{entry_id}">
     {/exp:channel:entries}
     <input type="submit" value="submit">
{/exp:cartthrob:multi_add_to_cart_form}

I'd very much appreciate if anyone with CT 2.5 and EE 2.8.1 could confirm if they can get the multi_add_to_cart tag working at all.

1 Answer 1

0

Just got a scheduled callback from CartThrob support and it was a simple 5-minute fix. It turns out that the quantity field for each entry_id is required when using the {exp:cartthrob:multi_add_to_cart_form} tag pair. In the single {exp:cartthrob:add_to_cart_form} tag no quantity field is necessary, and adding to cart that way defaults the quantity to 1.

So the following code now sends the correct information to the cart:

{exp:cartthrob:multi_add_to_cart_form return="shopping_cart"}
     {exp:channel:entries channel="products" status="Open"}
          <input type="hidden" name="entry_id[{count}]" value="{entry_id}">
          <input type="hidden" name="quantity[{count}]" value="{entry_id}">
     {/exp:channel:entries}
     <input type="submit" value="submit">
{/exp:cartthrob:multi_add_to_cart_form}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.