Tagged: Buddyblog Pro Pay Per Post
Hi Tosin,
Thank you for your involvement.
Should I use both codes together?@brajesh What is your opinion?
Thank you
CristiHi Tosin,
The code has no performance issue. Clearing cart has no impact on performance(even if you have persistent cart enabled, it will only clear one user meta in that case).I will suggest 2 changes for sure
1. Instead of using $wooocommerce, a better option would be to useWC()->cart->empty_cart()
It is the same thing but safer.
2. The above code will clear the cart when the visit that specific page, irrespective of whether a user intends to write post or not.
A betters solution will be to clear cart before the post is published. Ravi or I will share a snippet for the same later today.
Regards
BrajeshHi Brajesh
I am looking forward for the snippet.
Thank you
CristiHi Cristi, Tosin
Please upgrade to 1.0.2 and then add the following code// clear cart before adding the product add_action( 'bblpro_ppp_before_add_to_cart', function () { WC()->cart->empty_cart( true ); } );
Regards
BrajeshHello,
1. @ravisharma thanks for the update I have tested the plugin and everything works perfectly now.
2. @brajesh your snippet also works smoothly for emptying cart.
Thanks
Hi,
Everything is perfect.
However it does not delete the images after deleting the article.
I have this plugin installed;
https://wordpress.org/plugins/dx-delete-attached-media/Should I make any other setting in BuddyBlog Pro, or change the plugin for deleting the images?
Thank you
CristiHi Brajesh
This code no longer works
/** * Assign (Sponsored Post) category to BuddyBlog pay per post articles on checkout. */ add_action( 'bblpro_ppp_post_published', function( $post_id ) { $post_type = get_post_type( $post_id ); if ( 'post' != $post_type ) { return; } // Get category. $newcat = get_term_by( 'name', 'Sponsored posts', 'category' ); if ( ! $newcat ) { return; } wp_set_post_categories( $post_id, $newcat->term_id, true ); } );
Hi Cristi,
We will be looking at the attachment issue in general(BuddyBlog Pro) next week. It seems to have no co-relation with the Pay Per Post.Regards
Brajesh
The topic ‘ [Resolved] Pay Per Post by selling access with WooCommerce’ is closed to new replies.