2

Exp:resso Store 2.3.1 and EE 2.8.1.

How can I include a download link right in the Order Confirmation email that Store sends out for any downloadable products in that order?

1 Answer 1

4

Including download links is perfectly possible.

First, set the Email Formatting to "HTML", since Store's Download Tag outputs HTML.

Second, use the same code in the email template that you would use in a regular EE template to display download links. Here's an example:

<ul>
    {items}
    <li>
        {title}
        {exp:channel:entries entry_id="{entry_id}"}
            {exp:store:download url="{product_file}" order_id="{order_id}"}
                Download
            {/exp:store:download}
        {/exp:channel:entries}
    </li>
    {/items}
</ul>

If you have multiple product channels (eg. "Books", "Music", etc) instead of a single "Products" channel, you need to add in some conditionals to only show download links for products in channels that have them. In the following example, only the "Music" channel has a downloadable product field:

<ul>
    {items}
    <li>
        Title: {title}
        {exp:channel:entries entry_id="{entry_id}"}
            {if channel_short_name == 'music'}
                {exp:store:download url="{music__file}" order_id="{order_id}"}
                    Download
                {/exp:store:download}
            {/if}
        {/exp:channel:entries}
    </li>
    {/items}
</ul>

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.