Advertisement
rijarob

Add dynamic link to receipt

Jun 13th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. {% block messaging %}
  2. {{ parent() }}
  3. <!-- customized link message -->
  4. {% set has_download = false %}
  5. {% set download_url = 'http://www.yourdownloadlinkhere.com/' %}
  6. {% for item in items %}
  7. {% if item.category == 'Your download category here' %}
  8. {% set has_download = true %}
  9. {% set download_url = download_url ~ 'linktofile' ~ item.code ~ '.zip' %}
  10. {% endif %}
  11. {% endfor %}
  12. {% if has_download %}
  13. <div id="fc-messages" class="fc-receipt__section">
  14. <div class="fc-alert fc-alert--success">
  15. <a href="{{ download_url }}">Download your records</a>
  16. </div>
  17. </div>
  18. {% endif %}
  19. <!-- /customized link message -->
  20. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement