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.

1
  • Can you rephrase the question, perhaps with an example? Jul 2, 2013 at 10:12

2 Answers 2

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.

0
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}

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.