Account login for pay per view plugin

I would like to have users login even for a single purchase, and then allow them access to a record of all of their purchases when logged in. Secondly, I would like to allow users to login via a link on the navbar to see their account. Is there a way I can do this?

Thanks.

  • Vaughan

    Hi Oliver,

    Hope you're well?

    This would require custom editing of the plugin to change the way it works. I haven't tested this at all so it might/probably will not work as expected.

    Can you try the following;

    Open up & edit /wp-content/plugins/pay-per-view/pay-per-view.php

    find around line 933

    // One time view option. Redirection will be handled by Paypal Express gateway
    			if ( $this->options["one_time"] ) {
    				$content .= '<div class="ppw_inner ppw_inner' . $n . '">';
    				$content .= '<form method="post" action="#">';
    				$content .= '<input type="hidden" name="ppw_content_id" value="' . $id . '" />';
    				$content .= '<input type="hidden" name="ppw_post_id" value="' . $post->ID . '" />';
    				$content .= '<input type="hidden" name="ppw_total_amt" value="' . $price . '" />';
    				if ( trim( $description ) == '' ) {
    					$description = 'content';
    				}
    				$content .= '<input type="submit" class="ppw_submit_btn" name="ppw_otw_submit" value="' . str_replace( array(
    						"PRICE",
    						"DESCRIPTION"
    					), array( $price, $description ), $this->options["one_time_description"] ) . '" />';
    				$content .= '</form>';
    				$content .= '</div>';
    			}

    Replace with;

    // One time view option. Redirection will be handled by Paypal Express gateway
    			if ( $this->options["one_time"] ) {
    				$content .= '<div class="ppw_inner ppw_inner' . $n . '">';
    				$content .= '<form method="post" action="#">';
    				$content .= '<input type="hidden" name="ppw_content_id" value="' . $id . '" />';
    				$content .= '<input type="hidden" name="ppw_post_id" value="' . $post->ID . '" />';
    				$content .= '<input type="hidden" name="ppw_total_amt" value="' . $price . '" />';
    				if ( trim( $description ) == '' ) {
    					$description = 'content';
    				}
                    $content .= '<input class="ppw_submit_btn ';
    				// Force login if user not logged in
    				if ( ! is_user_logged_in() ) {
    					$content .= ' ppw_not_loggedin'; // Add a class to which javascipt is bound
    					if ( $this->options['accept_api_logins'] ) {
    						$content .= ' ppw_accept_api_logins'; // Add a class to which javascipt is bound
    					}
    				}
    				$content .= '" type="submit" class="ppw_submit_btn" name="ppw_otw_submit" value="' . str_replace( array(
    						"PRICE",
    						"DESCRIPTION"
    					), array( $price, $description ), $this->options["one_time_description"] ) . '" />';
    				$content .= '</form>';
    				$content .= '</div>';
    			}

    However, there isn't an actually account page with previous transactions on, But the users can view their payperview expiry dates on their profile page.

    The login link in the menu itself, hopefully this article should get you going. https://support.woothemes.com/hc/en-us/articles/203106357-Add-Login-Logout-Links-To-The-Custom-Primary-Menu-Area

    Hope this helps