Would there be a way in Expresso Store to pre populate a cart with certain products?

And even better, to populate the cart based on a link? E.g to send a link to a customer and when the customer clicks the link he is taken to the cart with products X, Y and Z already in the cart?

1 Answer 1


I would recommend populating an Expresso Add to Cart form (Docs), making the form elements hidden and styling the submit button to look like a link, seems the most straight forward way...

Here's an example from the Docs, that I have modified to suit. The below example will add 1 of every product in the channel entry loop :

{!-- start the product form --}
  {!-- iterates the products channel --}
  {exp:channel:entries channel="products"}
    {!-- individual product form elements --}
    {exp:store:product entry_id="{entry_id}" disable_form="yes"}

      <input type="hidden" name="items[{count}][entry_id]" value="{entry_id}" />
      <input type="hidden" name="items[{count}][item_qty]" value="1" />


  {!-- Form submit, looks like a link --}
  <input type="submit" value="Add to Cart" style="background-color:transparent; text-decoration:underline; border:none; color:blue; cursor:pointer;" />


To select the products use the entry_id Tag on the exp:channel:entries loop.

If you wanted to go 'off the reservation' you could construct the post array in PHP and submit it to the relivent ACTion ID or Expresso Store Model function, put the code on a seperate template and link to that template, but thats another ball game, and Expresso probsbly won't recommend it!! :D

  • confused... apparently I got -15 points for this answer today, why has the answer tick been unaccepted? Is there a further issue with this? Anything we can help with??
    – Blatant
    Jun 17, 2015 at 15:45

Your Answer

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

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