• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

[ask] BuddyCommerce Membership Display

starkids

Active member
Sep 21, 2020
172
68
28
Hi babiato,
I'm integrating buddyboss with buddycommerce, so we can see the type of membership.
but we can only see our membership (current user), how do we get other users to see our membership type, or we can see another user membership displayed on buddyboss profile page.

Plugins link : https://wordpress.org/plugins/buddycommerce/
 

Attachments

  • Screenshot 2022-11-01 201222.png
    Screenshot 2022-11-01 201222.png
    22.8 KB · Views: 6
you can do so by creating a custom function with the following:
function sv_wc_memberships_my_memberships_shortcode() {

// bail if Memberships isn't active or we're in the admin
if ( ! function_exists( 'wc_memberships' ) || is_admin() ) {
return;
}

// buffer contents
ob_start();

?>
<div class="woocommerce">
<h2><?php esc_html_e( 'My Memberships', 'textdomain' ); ?></h2>
<?php
wc_get_template( 'myaccount/my-memberships.php', array(
'customer_memberships' => wc_memberships_get_user_memberships(),
'user_id' => get_current_user_id(),
) );
?>
</div>
<?php

// output buffered content
return ob_get_clean();
}
add_shortcode( 'wcm_my_memberships', 'sv_wc_memberships_my_memberships_shortcode' );

You can also get the user tab creator for buddypress to create a new section on user profiles where you can add the shortcode: [wcm_my_memberships] to dispaly the membership..
hope that helps
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock