• Resolved wpdev917

    (@wpdev917)


    Hello,
    The plugin is working fantastic for the purchase flow and gaining access. The only issue I’m having is with the shortcode that displays purchased products. When I pull from the “purchased” template, it does not return any results. When I pull from the “has_access” template, it does show the correct results but the linking seems to be broken. Here’s a screenshot of the code…

    https://capture.dropbox.com/uwcAUkq6o1bjvlUE

    Ideally we would use the purchased template but I’m open to using whatever works as long as we can link to the protected page from the shortcode results.

    If it matters, we’re using the Divi theme and granting access to standard WP pages.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matt Pramschufer

    (@mattpramschufer)

    hey @wpdev917 thanks for reaching out. So the shortcodes actually use a transient cache to improve the performance of rending the shortcodes. One thing you might try is going to Admin->Pay for Post->Debug and scrolling down to the transients section and clicking the clear transients button. By default transients are set to expire after 24 hours and get regenerated. If that is too long of an timeframe you can adjust that transient expiration time using the following filter.

    add_filter('wc_pay_per_post_posts_transient_time', function(){ return 10800; });

    You need to return the number of SECONDS that you want the transient to stay in place.

    Another option you can do is on the shortcode itself you can add the parameter of
    bypass_transients='true'

    So the shortcode would be
    [woocommerce-payperpost template='purchased' orderby='post_date' order='DESC' bypass_transients='true']

    Let me know if that solved your issue!

    Thread Starter wpdev917

    (@wpdev917)

    Hey Matt,
    Thanks for the quick response. The shortcode parameter was exactly what I needed.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Purchased Products Shortcode’ is closed to new replies.