Go to home page after clicking the download link in thank you page

Divi Forms
5 November, 2019 10:35:38
Hauzz
Topics: 1
Messages: 7
I'm using E2PDF with Divi 4 on a restaurant web site. Customers can choose to download a special offer voucher.
After filling in the contact form I would like to have the download link displayed on my custom thank you page.
Then after the user clicks the download link it would be nice to go to a specific page.

Is that even possible?
If not, could you give me an idea to prevent customers to download the voucher over and over again?

Thanks in advance,
Hans Westerhof

6 November, 2019 04:00:05
Oleksandr
Support
Topics: 3
Messages: 870
Hi,

Unfortunately it's not possible now to limit downloads. We are now working on conditions for PDF downloads so we will check the possiblity to add support to disallow downloads after reaching some limit.

As a temporary solution you can add custom javascript code on "form" page, it will open new window with PDF and old page will be redirected to other page:

<script>
jQuery(document).ready(function () {
jQuery(".e2pdf-download").live( "click", function(e) {
e.preventDefault();
var href = jQuery(this).attr('href');
window.open(href, '_blank');
window.open('http://www.google.com', '_self');
});
});
</script>

We remain at your service.
If you appreciate our support , we would really appreciate your feedback at WordPress.org!
7 November, 2019 02:34:13
Hauzz
Topics: 1
Messages: 7
Hi Oleksandr,

Thanks for your answer.
I've added a code module in the section where the form is also. I've pasted the above code in de code module.
Redirection of the form is turned off.
I'm not a programmer, but what I understand from reading the code is that a new window should open showing the pdf, and the page with the form woud be redirected to Google.
Nothing happens though
7 November, 2019 02:41:41
Oleksandr
Support
Topics: 3
Messages: 870
Hi,

Can you please shere the link where form is located so we can take a look it directly on your side? Thank you.

P.S. You can mark message "PRIVATE" so only we can see your message with url.

We remain at your service.
If you appreciate our support , we would really appreciate your feedback at WordPress.org!
7 November, 2019 03:49:16
Oleksandr
Support
Topics: 3
Messages: 870
It looks like you missed up to add [e2pdf-download id="1"] shortcode to Success Message or it's connected to another form/not activated.

We remain at your service.
If you appreciate our support , we would really appreciate your feedback at WordPress.org!
7 November, 2019 03:55:02
Hauzz
Topics: 1
Messages: 7
That works Oleksandr, thanks for your help