Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: Code conflict #46240

    Gentle reminder sir

    Thanks

  • Participant
    Level: Guru
    Posts: 915

    Hi Brajesh

    I had to add the value (true) to get it to work

    WC()->cart->empty_cart( true );

  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: buddyblog medium editor not displaying embeds #46238

    Thanks Brajesh

    The issue with the space is now resolved

  • Participant
    Level: Guru
    Posts: 915
    This reply has been marked as private.
  • Participant
    Level: Guru
    Posts: 915

    Hello Niculae,

    I solved this problem using the code to empty cart on (create-new-post) page load.

    
     /* Empty woocommerce cart on a specific page to avoid conflict with buddyblog pay per post */
    add_action( 'template_redirect', 'woocommerce_clear_post_cart_url' );
    function woocommerce_clear_post_cart_url() {
        global $post;
        $slug = $post->post_name;
        if($slug == 'create-new-post') {
            global $woocommerce;
            $woocommerce->cart->empty_cart();
        }
    } 
    

    @brajesh I’ll like to ask regarding the code above. what effect will the code have when multiple users load the (create-new-post) page. I hope it would not affect site performance, if it will, can the code be refined for better optimisation.

    Maybe adding a condition not to run the code when user cart is empty

    Thanks

  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: buddyblog medium editor not displaying embeds #46222

    Gentle reminder sir

    Thanks

  • Participant
    Level: Guru
    Posts: 915

    Hello Brajesh,

    I just tested the plugin 8 times now but users aren’t redirected to cart or checkout even when product pricing has been selected. They aren’t redirected to cart or checkout even if the option (Enable Force Purchase) is enabled or disabled.

    All posts are being submitted freely

    Just in case i have this code enabled

    /*Auto Complete Paid WooCommerce Orders*/
    function wc_autocomplete_processing_orders() {
       return 'completed';
    }
    add_filter( 'woocommerce_payment_complete_order_status', 'wc_autocomplete_processing_orders', 9999 );

    Thanks

    • This reply was modified 3 years, 3 months ago by Tosin.
  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: Code conflict #46179

    Please note that I dont want to hide the Following tab using css

  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: buddyblog medium editor not displaying embeds #46166

    There is a lot of space in the embed also when I use chrome inspect element I can see this in the video embed

    
    <p>
      <!--?xml version="1.0" standalone="yes"?-->
      <br>
      <br>
      <br>
    </p>
    
    

    see space at https://ibb.co/nj9Qh6n

  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: buddyblog medium editor not displaying embeds #46165

    Thanks Brajesh

    I just tested it and the embeds are working now. The only difference now is when the video link is added via the editor the video preview does not show again like before. I am not sure maybe this is intentional but I also think its good because now the video preview does not interfere with the user writing experience.