BuddyDev

Search

[Resolved] Pay Per Post by selling access with WooCommerce

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #45983

    Hi,

    I also have in the functions.php file these codes related to BuddyBlog Pro.

    /**
    * BuddyBlog Pro woocommerce validation rule Not adding Points to Pending Article.
    */
    add_action( ‘woocommerce_order_status_completed’, function () {
    add_filter( ‘gamipress_user_deserves_trigger’, ‘__return_true’ );
    }, 9 );

    add_action( ‘wp_ajax_bblpro_submit_post’, function () {
    add_filter( ‘gamipress_user_deserves_trigger’, ‘__return_false’ );
    }, 9 );

    /**
    * BuddyBlog Pro field validation rule Not adding Points to Pending Article.
    */
    add_filter(‘bblpro_validation_errors’, function ($errors, $submitted_data, $post_data) {

    $status = $post_data[‘post_status’];

    if (!empty($submitted_data[‘bbl_post_title’]) && bblpro_custom_get_words_count($submitted_data[‘bbl_post_title’]) > 20) {
    $errors->add(‘bbl_post_title’, __(‘Titlul poate să conțină maxim de 20 de cuvinte.’));
    }

    // additional check for publish.
    if (‘publish’ === $status && bblpro_custom_get_words_count($submitted_data[‘bbl_post_content’]) > 5000) {
    $errors->add(‘bbl_post_content’, __(‘Articolul poate să conțină maxim 5000 de cuvinte.’));
    }

    return $errors;
    }, 10, 3);

    /**
    * Counts number of words in a string.
    *
    * @param string $str string.
    *
    * @return int
    */
    function bblpro_custom_get_words_count($str)
    {
    $words = preg_split(“/[\n\r\t ]+/”, $str, -1, PREG_SPLIT_NO_EMPTY);

    return count($words);
    }
    /**
    * End BuddyBlog Pro field validation rule.
    */

    Cristi

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #45987

    Hi Cristi,
    Thank you for reporting the issue.

    Yes, there were some issue with Pay per Post. we are in the process of releasing it on BuddyDev this weekend and it will have the fix.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #45989

    Hi,
    This is a great news.
    I am looking forward to this update.
    Thank you
    Cristi

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #46025

    Hi Cristi,
    Thank you.

    I am sorry to inform that we will be needing couple more days to put the final version. I am hoping it to be available early next week now.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #46077

    Thanks Brajesh

    Im really looking forward to the final version as my users complain that they are redirected to checkout for free post whenever they try to edit any post.

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #46084

    Dear Ravi,

    Please can you make the code below work for only (sponsored post) submission type the second code with return_false should not affect (free post) submission type

    add_action( 'woocommerce_order_status_completed', function () {
    	add_filter( 'gamipress_user_deserves_trigger', '__return_true' );
    }, 9 );
    
    add_action( 'wp_ajax_bblpro_submit_post', function () {
    	add_filter( 'gamipress_user_deserves_trigger', '__return_false' );
    }, 9 );
  • Participant
    Level: Guru
    Posts: 900
    Tosin on #46103

    Kind Reminder Ravi

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #46121

    Hi,
    Do you think that this week will be ready the update?
    Thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #46128

    Hi Niculae,
    Yes, we will be making a release this week for sure.

    @ Tosin,
    We are unable tp provide you assistance with any custom code until the plugin is available as public release. Using custom codes at this state has been very limiting as it forces us to not change our API.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 21
    Nancy Ketola on #46190

    Hello – I am hoping to purchase this plugin. Is it avaialable for download yet? Does this work with BuddyBlog Pro?

The topic ‘ [Resolved] Pay Per Post by selling access with WooCommerce’ is closed to new replies.

This topic is: resolved