[ask] BuddyCommerce Membership Display

starkids

Active member
Sep 21, 2020
122
40
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: 3

radumcristian

New member
Feb 13, 2021
7
10
3
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
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu