• Resolved affiliatenow

    (@affiliatenow)


    I have successfully added the custom post type to the “woocommerce-payperpost.php” file as follows:

    add_meta_box('woocommerce-payperpost-meta-box', __('WooCommerce Pay Per Post', 'textdomain'), __CLASS__ . '::output_meta_box', 'courses', 'normal', 'high');

    The Meta Box does show up and I can add the product ID… but the post is not protected.

    https://wordpress.org/plugins/woocommerce-pay-per-post/

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

    (@mattpramschufer)

    Do you have an example site that I can look at?

    Plugin Author Matt Pramschufer

    (@mattpramschufer)

    I am going to close this thread. If you continue to have issues let me know!

    Thread Starter affiliatenow

    (@affiliatenow)

    Sorry, I never saw any emails that you updated the case.

    https://www.isuccesslab.com/?courses=isuccess-university-orientation

    This is a page that is “protected” by the plugin and I selected that you need to purchase product id #172

    https://www.isuccesslab.com/product/isuccess-university-orientation/

    But the protected page is open to the public, without buying Product ID #172

    Thank you for your assistance, as this is huge for my site!

    Plugin Author Matt Pramschufer

    (@mattpramschufer)

    Do you have a temp login and password I could get so I can login and debug for you? You can email me at matt@pramschufer.com

    Thread Starter affiliatenow

    (@affiliatenow)

    That would be great if you could help resolve this… I have emailed you a link to access my site!

    is possible add this to custom post? i dont see this options in custom post but in normal wp post its working.

    sorry affiliatenow solution works. but i forgot flush browser cache.

    Nice πŸ™‚

    Thread Starter affiliatenow

    (@affiliatenow)

    Well, hopefully we can figure out why my Custom Post types are not being protected.

    Plugin Author Matt Pramschufer

    (@mattpramschufer)

    So affiliatenow I am not sure this is going to work with WP Execution Plan. Even though it is a custom post type, WPEP doesn’t utilize the standard wordpress the_content(). That is why the PPP plugin hooks into to check and see if user has purchased or needs to purchase.

    The login that you sent me doesn’t allow me to see plugins or make edits to plugin so I can’t help you implement a fix. But I was able to do some development on my end and found on if you make some changes to the WPEP /lib/inc/templates/courses.php we can add in the following at line 22

    $product_id = get_post_meta( $course_id, 'woocommerce_ppp_product_id', true );
    
    if(!\Woocommerce_PayPerPost::checkForProduct($product_id)){
    	echo str_replace( '{{product_id}}', $product_id, get_option( 'wcppp_oops_content' ) );
    } else {

    and then replace the last line of the file with

    <?php } get_footer(); ?> and this page is now protected.

    Thread Starter affiliatenow

    (@affiliatenow)

    Brilliant!

    That now protects the WPEP posts… the only issue I see is that it lists the “Product ID” instead of a buy button like on other posts.

    This Page is restricted to customers that have purchased this product.
    [product id=”172″]

    This is a great product, I hope it keeps up to date with all the crazy WooCommerce changes for a long time!

    P.S. You should have more rights too, sorry about that!

    Thread Starter affiliatenow

    (@affiliatenow)

    also, not sure if it is related… but it only displays the first product selected when I select multiple ID’s

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Custom Post Type Not Protected’ is closed to new replies.