3

Is there a way to mimic the add item to cart so a product(subscription) is added to cart during a registration process? In short I wanted to automatically add item in the cart using Expresso Store, that is if it's possible.

  • Can you rephrase the question, perhaps with an example? – Adrian Macneil Jul 2 '13 at 10:12
2

It is possible to add a product to the cart by simply visiting a page so upon successful registration you could redirect them to a success page which then adds the subscription item to their cart in the background.

It can be achieved by using AJAX to POST directly to Store's action URL. You simply add the add the product tag to the page as normal and then using JavaScript to make the submission automatically. Along these lines:

$("#productform").submit()

Where #productform is the ID of your form.

This can either be hidden or visible.

| improve this answer | |
1

You could also use the Product Form Tag so that you can add multiple items to the cart with a single Add to Cart form and submit button. You would need to have something along the lines of:

{exp:store:product entry_id="{subscription_entry_id}"}
<input type="hidden" value="1" name="item_qty" />
{/exp:store:product}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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