1

I am trying to display my download links on the page that displays all your purchases. This code below just does not seem to work.

<h1>Your Purchases</h1>
{exp:channel:entries channel="orders" author_id="CURRENT_USER" status="open|Completed|closed|Registration Closed"}
{exp:cartthrob:order_items order_id="{entry_id}" variable_prefix="items_"}
{if items_first_item}
Total number of items: {items_total_results}.
<table>
<thead>
<tr>
<td width="60">ID</td>
<td width="350">Title</td>
<td width="20">Qty</td>
<td width="90">Invoice</td>
<td>&nbsp;</td>
</tr>
</thead>
<tbody>
{/if}
<tr class="{items_switch="odd|even"}">
                        <td valign="top">#{items_count}: {items_entry_id}</td>
                        <td valign="top">
                      {items_title}{if items_size} - {items_size}{/if}</td>
                      <td valign="top">{items_quantity}</td>
                      <td valign="top"><a href="{path=courses/invoice}/{entry_id}">View invoice</a></td>
<td valign="top">     
{if item:product_download_url}
<span ><a href="{exp:cartthrob:get_download_link field='product_download_url' entry_id='{item:entry_id}'}">Download</a></span>
{/if}
    {if purchased_license_number}
    <p>License number: {purchased_license_number}</p>
    {/if}</td>
                    </tr>
                    {if items_count == items_total_results}
                </tbody>
        </table>
        {/if}
    {/exp:cartthrob:order_items}
    {if no_results}
<p><strong>You have no orders in your account.</strong></p>
{/if}
{/exp:channel:entries}
2

I've had success using the following to display download links:

{exp:cartthrob:download_file_form field="product_download_url" entry_id="{item:entry_id}" }
        <input type="submit" value="Download Now!" /> 
{/exp:cartthrob:download_file_form}

Also, I don't know if it would make a difference but what happens if instead of

order_id="{entry_id}"

you use

order_id="{purchased_order_id}"

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.