issue with pay per view plugin

HI I think ive worked it out on how to apply to the content. But when you have paid the fee eg £0.25 then it takes you back from paypal to the website but it show the following screen (capture image attached) confirm 0.25 GBP payment to see content - can I chnage this? its not clear what they have to do? can I remove this button once they have paid? it needs to say click here to confirm ********* or taking out?
Also how do I change the color of the button I would like it blue button white bold text

  • Milan

    Hi @rusola,

    I hope you are having an awesome day. :slight_smile:

    "Confirm payment" button used in pay per view to co-ordinate with PayPal express checkout. When user makes payment via paypal, one token is generated which can be used to confirms that payment has been made. So pay per view uses this "Confirm Payment" button to confirm payment. Removing that button is not a good idea..

    Please try out this css snippet to style this button.

    input[name="ppw_final_payment"]{
    	color: white !important;
    	background-color: blue !important;
    	font-weight: bold !important;
    }

    I hope this helps you..

    Please let me know if there is anything else I can help you with..

    Warmest Regards,
    Milan..

  • Milan

    Hi @rusola,

    I hope you are having a good day..

    As I told you on this thread https://premium.wpmudev.org/forums/topic/implementing-pay-per-view-not-working by mistake you responded on wrong thread about this issue. So here I'd like to answer here as our communication remains on same track. :slight_smile:

    I have added the css code into the Simple Custom CSS code to change the colour of the button to blue but this did not work.

    I've updated CSS on your site with some minor tweak. It is working fine now. You can check it. :slight_smile:

    . Is there away of changing this text? (message says (on the button) "Confirm Payment" when returning from paypal )

    You can use this snippet in current active theme's functions.php file or child themes functions.php file. You can find functions.php file of current theme by navigating to current theme directory. It will be placed just under that theme's root folder. So let say for example you are using twentyfifteen theme then it's functions.php file will be at wp-contents/themes/twentyfifteen/functions.php.

    Just one here I'd like to mention is that using this code inside current themes functions.php file is not safe as it will be removed when theme gets updated.

    add_action( 'wp_footer', 'inject_my_jquery_snippet' );
    function inject_my_jquery_snippet{
       ?> 
    
           jQuery(document).ready(function($) {
    	var $buttonElement = $("input[name='ppw_final_payment']");
    
    	if( $buttonElement.length > 0 ){
    		$buttonElement.val( 'Text which you wanted to replace. ' );
    	}
    
    });
    
       <?php
    }

    I hope this helps you..

    Please let me know if there is anything else I can help you with..

    Enjoy Wpmudev..

    Warmest Regards,
    Milan..

  • rusola

    Hi

    I have added the cod, but it broke the website and didnt work. this is the functions.php file where would i add it in?

    <?php

    /* Register Thumbnails Size
    ================================== */

    if ( function_exists( 'add_image_size' ) ) {

    /* Slider */
    add_image_size( 'slider', option::get('slider_thumb_width'), option::get('slider_thumb_height'), true );
    add_image_size( 'slider-small', 135, 98, true );

    /* Recent Posts Widget */
    add_image_size( 'recent-widget', 60, 45, true );

    }

    /* Default Thubmnail */
    update_option('thumbnail_size_w', 228);
    update_option('thumbnail_size_h', 160);
    update_option('thumbnail_crop', 1);

    /* Register Custom Menu
    ==================================== */

    register_nav_menu('secondary', 'Top Menu');
    register_nav_menu('primary', 'Main Menu');

    /* Add support for Custom Background
    ==================================== */

    if ( ui::is_wp_version( '3.4' ) )
    add_theme_support( 'custom-background' );
    else
    add_custom_background( $args );

    /* Custom Excerpt Length
    ==================================== */

    function new_excerpt_length($length) {
    return (int) option::get("excerpt_length") ? (int) option::get("excerpt_length") : 80;
    }
    add_filter('excerpt_length', 'new_excerpt_length');

    /* Reset [gallery] shortcode styles
    ==================================== */

    add_filter('gallery_style', create_function('$a', 'return "<div class=\'gallery\'>";'));

    /* Show all thumbnails in attachment.php
    =========================================== */

    function show_all_thumbs() {
    global $post;

    $post = get_post($post);
    $images =& get_children( 'post_type=attachment&post_mime_type=image&output=ARRAY_N&orderby=menu_order&order=ASC&post_parent='.$post->post_parent);
    if($images){
    foreach( $images as $imageID => $imagePost ){
    if($imageID==$post->ID){

    unset($the_b_img);
    $the_b_img = wp_get_attachment_image($imageID, 'thumbnail', false);
    $thumblist .= ''.$the_b_img.'';

    } else {
    unset($the_b_img);
    $the_b_img = wp_get_attachment_image($imageID, 'thumbnail', false);
    $thumblist .= ''.$the_b_img.'';
    }
    }
    }
    return $thumblist;
    }

    /* Email validation
    ==================================== */

    function simple_email_check($email) {
    // First, we check that there's one @ symbol, and that the lengths are right
    if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
    // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
    return false;
    }

    return true;
    }

    /* Video Embed Code Fix
    ==================================== */

    function embed_fix($videoexternal,$width,$height) {
    if (function_exists('jwplayer_tag_widget_callback')) {
    $videoexternal = jwplayer_tag_widget_callback($videoexternal);
    }

    $videoexternal = preg_replace("/(width\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 ".$width." $2", $videoexternal);
    $videoexternal = preg_replace("/(height\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 ".$height." $2", $videoexternal);
    if (strpos($videoexternal, "<embed src=" ) !== false) {
    $videoexternal = str_replace('</param><embed', '</param><param name="wmode" value="transparent"></param><embed wmode="transparent" ', $videoexternal);
    }
    else {
    if(strpos($videoexternal, "wmode=transparent") == false){

    $re1='.*?'; # Non-greedy match on filler
    $re2='((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s"]*))'; # HTTP URL 1

    if ($c=preg_match_all ("/".$re1.$re2."/is", $videoexternal, $matches))
    {
    $httpurl1=$matches[1][0];
    }

    if(strpos($httpurl1, "?") == true){
    $httpurl_new = $httpurl1 . '&wmode=transparent';
    }
    else {
    $httpurl_new = $httpurl1 . '?wmode=transparent';
    }

    $search = array($httpurl1);
    $replace = array($httpurl_new);
    $videoexternal = str_replace($search, $replace, $videoexternal);

    //print($httpurl_new);
    unset($httpurl_new);

    }
    }
    return $videoexternal;
    }

    /* Maximum width for images in posts
    =========================================== */
    if ( ! isset( $content_width ) ) $content_width = 600;

    /* Limit Posts
    /*
    /* Plugin URI: http://labitacora.net/comunBlog/limit-post.phps
    /* Usage: the_content_limit($max_charaters, $more_link)
    =============================================================== */

    function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '', $echo = true) {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    $content = strip_tags($content);

    if (strlen($_GET['p']) > 0 && $thisshouldnotapply) {
    echo $content;
    }
    else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
    $content = substr($content, 0, $espacio);
    if ($echo == true) { echo $content . "..."; } else {return $content; }
    }
    else {
    if ($echo == true) { echo $content . "..."; } else {return $content; }
    }
    }

    /* Video auto-thumbnail
    ==================================== */

    if (is_admin()) {
    WPZOOM_Video_Thumb::init();
    }

    /* Breadcrumbs
    ==================================== */

    function wpzoom_breadcrumbs() {

    $delimiter = '»';
    $name = 'Home'; //text for the 'Home' link
    $currentBefore = '<span class="current">';
    $currentAfter = '</span>';

    if ( !is_home() && !is_front_page() || is_paged() ) {

    global $post;
    $home = get_bloginfo('url');
    echo '' . $name . ' ' . $delimiter . ' ';

    if ( is_category() ) {
    global $wp_query;
    $cat_obj = $wp_query->get_queried_object();
    $thisCat = $cat_obj->term_id;
    $thisCat = get_category($thisCat);
    $parentCat = get_category($thisCat->parent);
    if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
    echo $currentBefore . '';
    single_cat_title();
    echo '' . $currentAfter;

    } elseif ( is_day() ) {
    echo '' . get_the_time('Y') . ' ' . $delimiter . ' ';
    echo '' . get_the_time('F') . ' ' . $delimiter . ' ';
    echo $currentBefore . get_the_time('d') . $currentAfter;

    } elseif ( is_month() ) {
    echo '' . get_the_time('Y') . ' ' . $delimiter . ' ';
    echo $currentBefore . get_the_time('F') . $currentAfter;

    } elseif ( is_year() ) {
    echo $currentBefore . get_the_time('Y') . $currentAfter;

    } elseif ( is_single() ) {
    $cat = get_the_category(); $cat = $cat[0];
    echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
    echo $currentBefore;
    the_title();
    echo $currentAfter;

    } elseif ( is_page() && !$post->post_parent ) {
    echo $currentBefore;
    the_title();
    echo $currentAfter;

    } elseif ( is_page() && $post->post_parent ) {
    $parent_id = $post->post_parent;
    $breadcrumbs = array();
    while ($parent_id) {
    $page = get_page($parent_id);
    $breadcrumbs[] = 'ID) . '">' . get_the_title($page->ID) . '';
    $parent_id = $page->post_parent;
    }
    $breadcrumbs = array_reverse($breadcrumbs);
    foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' ';
    echo $currentBefore;
    the_title();
    echo $currentAfter;

    } elseif ( is_search() ) {
    echo $currentBefore . 'Search results for '' . get_search_query() . ''' . $currentAfter;

    } elseif ( is_tag() ) {
    echo $currentBefore . 'Posts tagged '';
    single_tag_title();
    echo ''' . $currentAfter;

    } elseif ( is_author() ) {
    global $author;
    $userdata = get_userdata($author);
    echo $currentBefore . 'Articles posted by ' . $userdata->display_name . $currentAfter;

    } elseif ( is_404() ) {
    echo $currentBefore . 'Error 404' . $currentAfter;
    }

    if ( get_query_var('paged') ) {
    if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
    echo __('Page', 'wpzoom') . ' ' . get_query_var('paged');
    if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
    }

    }
    }

    function videozoom_featured_slider_assets() {
    global $jwPlayerIds;

    if (!is_home() || option::get('featured_enable') != 'on') {
    return;
    }

    ui::js("slides", "froogaloop");
    ?>

    <script src="http://www.youtube.com/player_api"></script>
    <script type="text/javascript">
    var youtubePlayers = [];
    var vimeoPlayers = [];
    var jwPlayers = [<?php echo implode(', ', $jwPlayerIds); ?>];
    var youtube_loaded = false;
    jQuery(document).ready(function($) {

    jQuery('#carousel').flexslider({
    animation: "slide",
    controlNav: true,
    directionNav: true,
    animationLoop: false,
    slideshow: false,
    pauseOnAction: true,
    pauseOnHover: true,
    itemWidth: 146,
    asNavFor: '#slider'
    });

    jQuery("#slider")
    .flexslider({
    controlNav: false,
    directionNav:true,
    animationLoop: false,
    slideshow: false,
    sync: "#carousel",
    video:true,
    animation: "<?php if (option::get('slideshow_effect') == 'Slide') { ?>slide<?php } else { ?>fade<?php } ?>",
    useCSS: false,
    smoothHeight: true,
    slideshow: <?php if (option::get('featured_rotate') == 'on') { echo "true"; } else { echo "false"; } ?>,
    <?php if (option::get('featured_rotate') == 'on') { ?>slideshowSpeed:<?php echo option::get('featured_interval'); ?>,<?php } ?>
    pauseOnAction: true,
    pauseOnHover: true,
    animationSpeed: 600,
    before: function() {
    $(vimeoPlayers).each(function(i, el) {
    $f(el).api('api_pause');
    });

    $(youtubePlayers).each(function(i, el) {
    if (youtube_loaded) el.stopVideo();
    });

    $(jwPlayers).each(function(i, el) {
    jwplayer(el).stop();
    });

    var i = 0;
    while (jwplayer(i) !== undefined) {
    jwplayer(i).stop();

    i++;
    }
    }
    });

    $(jwPlayers).each(function(i, el) {
    jwplayer(el).onBeforePlay(jwPlay);
    jwplayer(el).onPause(jwPause);
    });

    var i = 0;
    while (jwplayer(i) !== undefined) {
    jwplayer(i).onBeforePlay(jwPlay);
    jwplayer(i).onPause(jwPause);

    i++;
    }

    function jwPlay() {
    $('#slider').flexslider('pause');
    }

    function jwPause() {
    $('#slider').flexslider('play');
    }

    // Vimeo API magic
    var players = $('#slider iframe');

    players.each(function(i, player) {
    var src = $(player).prop('src');

    if (src.indexOf('vimeo') !== -1) {
    // enable Vimeo API
    $(player).prop('src', src + '&api=1&player_id=' + $(player).prop('id'));

    $f(player).addEvent('ready', vimeoReady);

    vimeoPlayers.push(player);
    }
    });

    // events workaround for IE
    function addEvent(element, eventName, callback) {
    if (element.addEventListener) {
    element.addEventListener(eventName, callback, false)
    } else {
    element.attachEvent(eventName, callback, false);
    }
    }

    function vimeoReady(playerID) {
    var fl = $f(playerID);

    fl.addEvent('play', function() {
    $('#slider').flexslider('pause');
    });

    fl.addEvent('pause', function() {
    $('#slider').flexslider('play');
    });
    }
    });

    // YouTube API...
    function onYouTubePlayerAPIReady() {
    jQuery(document).ready(function($) {
    var players = $('#slider iframe');

    players.each(function(i, player) {
    var src = $(player).prop('src');
    if (src.indexOf('youtube') !== -1) {
    // enable YouTube API
    $(player).prop('src', src + '&enablejsapi=1');

    youtubePlayers.push(new YT.Player($(player).prop('id'), {
    events: {
    'onStateChange': youtubeStateChange
    }
    }));
    }
    });
    });
    }

    function youtubeStateChange(event) {
    jQuery(document).ready(function($) {
    if (event.data === 1) {
    $('#slider').flexslider('pause');
    }

    youtube_loaded = true;
    });
    }
    </script>
    <?php
    }

    add_action('wp_footer', 'videozoom_featured_slider_assets');

  • Milan

    Hi @rusola,

    I trust you are having a good day. :slight_smile:

    You can copy php code snippet I've provided you in my last post at the end of current themes function.php file.

    You can verify that which theme you are currently using via Appearances > Themes .

    After verifying theme go to wp-contents/themes/{Activated_Theme_Name}. Under this director you will find file named functions.php. Open that file and paste php code at the end of the file.

    Kind Regards,
    Milan.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.