Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Possible to put APRTP Generate link on product page?
Tagged: apr pdf, APRTP, pay per view, ppv
- This topic has 15 replies, 3 voices, and was last updated 10 years ago by alexkir.
-
AuthorPosts
-
March 5, 2014 at 12:48 am #10037ellie123Member
I am using the APRTP setup for pages that I am selling access to, however my problem lies when a user logs in on a device other than the one they made their purchase from. When they do this, they can’t see the protected content.
It seems the only way to get around this is for the user to generate a new link, and that’s okay. I can deal with them having to do this every time if they’re going to use different devices. But, what I am trying to do is put the “Generate New Link” code on the actual product page. This way, the user can go to the page, if the protected content isn’t showing they can refresh it and have it right away instead of having to navigate through their purchase history.
Does that make sense? Instead of the shortcode showing a list of all their purchases with the option to generate new link, I want just one line put on the product’s page, (each product has its own page/post).
My question is where in the code can I find the script that generates the new download links? And before I dive in and try to figure this out, is it even possible for me to include the generate new link button on a per page basis? If so, can you give me a little nudge as to where I should start?
Thank you for any help or assistance you can provide…
Liz
March 5, 2014 at 12:57 am #61285ellie123MemberAs a follow-up…another post here in the forum asks for an idea similar to mine. This was from a year or 2 ago, this was the mod’s reply:
“I suppose, that if you really wanted to, and if you consider yourself a competent programmer, who enjoys “running with scissors,” you might be able to manually query the product database, grab the thumbnail URL for a particular product, along with the product URL, and then call the code that generates the encrypted URL. You could then display the encrypted URL, along with the thumbnail and whatever else you got from the product database. And since (I think) you wanted to have non-expiring links, then you might as well not even encrypt the product URL.”
– https://support.tipsandtricks-hq.com/forums/topic/provide-link-to-webpage-instead-of-download/page/2
So going with the theory above….where can I find the “code that generates the encrypted URL” … I,too, won’t need an expiring link or even encrypted. Hoping this May help with your answer?
March 5, 2014 at 1:29 am #61286wzpModeratorWell, you could also use the [wp_eStore_download_link_sender] shortcode on the page…
[wp_eStore_APR expiry=0 status=expired]
[wp_eStore_download_link_sender]
[/wp_eStore_APR]
Don’t forget to download the eStore extra shortcodes addon!
https://support.tipsandtricks-hq.com/forums/download-addons.php
March 5, 2014 at 4:20 am #61287ellie123MemberOkay that might work…is it possible to just have the user request the link just for that particular product?
For instance, let’s say the user needs to regenerate a link for Product 123 and he is on the 123post page.
Can I somehow have the link generator generate the link for just this particular product, instead of having the whole list of their purchases?
Do you know what I mean?
March 5, 2014 at 4:31 am #61288ellie123MemberSo, the user will open the page …
– the protected content will not be shown (since they’re on a different device)
– but, they can tap the new link button which will make a link they can go to
Right now, if I put the generate link shortcode on a page it shows a list of all purchases with a button on the right to generate a new link. I want only the product that the user is viewing to be there instead of the whole list.
Can you tell me where I can edit the code to do this? I think I need to know where the code is that makes the table, that way I should be able to make it show just the one particular product link and button.
March 5, 2014 at 3:55 pm #61289wzpModeratorFor APRTP protected pages, the process is more involved than it is with regular download links. You cannot just redirect to a page that you retrieved from the database; as you could with non APRTP protected pages.
Calling generate_download_link() with the product ID that corresponds to the APRTP protected page will return the text string that makes up the encrypted download link. You must then redirect to the encrypted download link that was returned by the function.
Upon redirection, the download.php script is invoked. It operates ***OUTSIDE*** the normal WordPress environment. It is at this point the APRTP cookie is created, and the user is then redirected to the APRTP protected page; which is back ***INSIDE*** the normal WordPress environment.
Now, as for a button… you could just use a regular old DOWNLOAD NOW button and it will automagically do everything that I just described.
March 5, 2014 at 4:33 pm #61290ellie123MemberOkay that sounds perfect…when you say “call the generate_download_link() with the product id” can you tell me the way I format that? I’m guessing I don’t use a shortcode do I?
I’m hoping I can put that in the sidebar? If not, I’ll just put in the body of the post…
I’m sorry to keep asking you, promise I’ll stop after this…lol
March 5, 2014 at 4:55 pm #61291wzpModerator[wp_eStore_APR expiry=0 status=expired]
Click Me!
[wp_eStore_download_now_button id=NNN]
[/wp_eStore_APR]
[wp_eStore_APR expiry=0 status=unexpired]
*****Protected Content Goes Here*****
[/wp_eStore_APR]
March 5, 2014 at 5:01 pm #61292wzpModeratorNow, of course I hope you are using eMember to protect that page. Otherwise, that last example is pretty useless.
October 30, 2014 at 10:03 am #61293alexkirMemberHi all,
I am trying to use APR feature to get filled-in with a customer entered data pdf file.
1. User buys a document, gets redirected to the protected page
2. Enters personal data required for the final document (via multi-step question/answer process)
3. The document then is converted to pdf format and gets sent to the customer or
gets downloaded from the site.
The problem is that none of the available plugins are able to capture text in APR protected area.
Can anyone suggest how to get to APR info and incorporate it to the document ?
Thank you
October 30, 2014 at 4:02 pm #61294wzpModerator2. Enters personal data required for the final document (via multi-step question/answer process)
https://www.tipsandtricks-hq.com/ecommerce/using-wordpress-permalinks-as-digital-products-apr-1217
Limitations
If an APR target contains the ‘nextpage’ tag (or continues on to another page), only content on the first page will be protected by the APR shortcodes.
Are all of the Q&A on the same APR protected page? This includes whatever you do to generate the PDF file.
The problem is that none of the available plugins are able to capture text in APR protected area.
How are you trying to “capture text?” Please be specific.
November 1, 2014 at 8:15 am #61295alexkirMemberThank you for your quick response. Your guidelines are clear.
APR area is already visible (doc is purchased state) for the info below.
========================================================================
Multi-form input will be looping and outputting results on the same page until the process is completed.
There is no redirect to other page. Everything is planned to be built and HTML->PDF converted on the same page. To convert HTML page to pdf, I was trying to use various HTML to PDF plugins.
November 1, 2014 at 12:54 pm #61296wzpModeratorMulti-form input will be looping and outputting results on the same page until the process is completed.
Each time an APR protected page is loaded or refreshed; the APR cookie is checked. The default expiry for APR cookies/pages is 30 minutes. So, if the process is completed in less than 30 minutes; there should be no problem. The issue seems to be your (unidentified) plugin being unable to read the APR protected page; in order to convert it, correct? Depending on how the completed “page” is passed to the converter; the APR protected page may just be “doing its job,” in preventing unauthorized access. Remember, the APR cookie is on the user’s browser; not on the server.
To convert HTML page to pdf, I was trying to use various HTML to PDF plugins.
What is one of the plugins you tried to use?
November 3, 2014 at 7:46 pm #61297alexkirMemberI had to change my approach after your explanation above.
Now I am trying to use gravity forms extended pdf plugin. I use their custom .php templates, which produce pdf files. Within these custom templates there is an option to enter HTML/PHP code. I inserted APR shorcode for purchased product.
APR protects the area, but NOT only hidden area is captured in final pdf, but the shortcode notation as well.
It looks like the template does not handle well shortcodes. Since the custom templates are written in php and html, I think if I can use instead of your shortcode
[wp_eStore_APR expiry=999 status=unexpired] [/wp_eStore_APR]
APR php function. It should work.
Can you please let me know how to call APR function, similar to what you give for other shortcodes, for example<?php echo wp_eStore_list_categories(); ?>
Thank you
November 3, 2014 at 10:21 pm #61298wzpModeratorYou can follow steps, similar to these, for finding the PHP functions that correspond to the shortcodes:
https://support.tipsandtricks-hq.com/forums/topic/emember-html-for-mandatory-forms#post-62333
-
AuthorPosts
- You must be logged in to reply to this topic.