modmore / Commerce_DigitalProduct

Digital product module for Modmore's Commerce.
5 stars 1 forks source link

Cannot get this to work at all #5

Closed getandyjones closed 3 years ago

getandyjones commented 4 years ago

HI there I am trying to use this to sell digital products, but when I add the snippet to the thank-you.twig template, the output is empty. There's no link to a file to download. I have followed the docs and asked on the forums, but cannot get it working.

This is my thank-you.twig file:

<div class="c-checkout c-checkout-step c-checkout-thankyou">
    <h2>{{ lex('commerce.order_confirmed') }}</h2>

    {% include 'frontend/response-messages.twig' %}

    <p>{{ lex('commerce.order_complete', {'id': order.reference}) }}</p>
</div>

<div  style="clear:both; width:100%; background:#efefef; padding:30px;" class="c-digital-products">
    {% for digitalProduct in digitalProducts %}
        <h4>{{ digitalProduct.product.name }} {{ lex('commerce_digitalproduct.pages') }}</h4>

        {% for resource in digitalProduct.resources %}
            <p><a href="[[~DOWNLOADRESOURCE]]?secret={{ resource.secret }}">{{ resource.name }}</a></p>
        {% endfor %}

        <h4>{{ digitalProduct.product.name }} {{ lex('commerce_digitalproduct.files') }}</h4>
        {% for file in digitalProduct.files %}
            <p><a href="[[~DOWNLOADRESOURCE]]?secret={{ resource.secret }}">{{ file.name }}</a></p>
        {% endfor %}
    {% endfor %}
</div>

<div class="c-checkout-summary">
    {% include 'frontend/checkout/partial/summary.twig' %}
</div>

I have a shipping method setup in Commerce as 'Digital Product' and also have enabled the module.

The product type is also set up as digital product.

On inspecting the source of the thank you page - I can see that it's outputting an empty div:

<div class="c-digital-products">
</div>

Any tips/ideas on how to get this working?

Can I add the download link to the thanks email instead?

Thanks Andy

Mark-H commented 4 years ago

This module uses an event that's no longer triggering in Commerce v1.1 to handle the processing. #4 is somewhat related, though a quicker fix would be to change to the state change event.

Mark-H commented 3 years ago

I'm closing this as the dev builds (available from modmore.com - modx.com release to follow with stable) now work again :)

getandyjones commented 3 years ago

Ok cool - will give it another go - thanks Mark! :)


[image: tyga] Andy Jones Creative Director TYGA Marketing Limited 01727 898 191 <00441727898191> www.tyga.co.uk https://twitter.com/tygamarketing https://www.facebook.com/tygamarketing/ https://www.youtube.com/channel/UCIa2YVBEgBjutTg79e3yX3A

On Fri, 28 May 2021 at 04:22, Mark Hamstra @.***> wrote:

I'm closing this as the dev builds (available from modmore.com - modx.com release to follow with stable) now work again :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/modmore/Commerce_DigitalProduct/issues/5#issuecomment-850082641, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGL3NQQS6Y3PJM6C33ZMVTTP4D7PANCNFSM4M3HWWDA .