2

Is there a way that you can return a hash of the order line as part of the "Add to basket" button?

For example,

/basket/added/ORDER_ITEM_HASH

Then, it would be great if on the page you can find the order item by this hash and show the user an informative notification rather than a simple "Added to basket" message.

You have added the Acme 3000 to your basket with the following options:-

  • Colour: Red
  • Size: Large
  • Qty: 4
2

I don't think there's a way to do it exactly like you're asking.

Perhaps you could add a {exp:store:cart} tag at the top where you want to display the message and inside the {items} loop, use a conditional to only show the last item added. Something like this

{exp:store:cart}
    {items}
         {if item:count == item:total_results}
            display item
         {/if}
    {/items}
{/exp:store:cart}
  • That's a pretty clever solution - I'll give it a go first thing in the morning. Thanks! – Mutual Dec 4 '13 at 18:42
  • Why thank you :) Hopefully it works ok. I'm not sure if it has performance implications with lots of queries or anything. – Jeremy Gimbel Dec 4 '13 at 18:46
  • Good idea! You could also match on the entry_id or url_title if you want to show any previous versions of this item already added. – Adrian Macneil Dec 4 '13 at 21:20

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.