how to add a download link in fancybox

how to add a download link in fancybox

How to add a download link in fancybox, i'm using opencart.

i found this code:

$(".fancybox").fancybox({
    afterLoad: function() {
        this.title = '<a href="' + this.href + '">Download</a> ' + this.title;
    },
    helpers : {
        title: {
            type: 'inside'
        }
    }
});

Where to put exactly ?

tnx