buddypress-woocommerce
buddypress-woocommerce copied to clipboard
order details not showing inside buddypress profile
if I click on the order details, the order details are shown in http://website/my-account/order/orderid. It's better if the order details can be shown inside the buddypress profile
+1
Yes I'm having the same issue I'm not able to view the order details in buddypress profile I added a case for view-order then url is generated fine but when I visit ,it displays page not found Please help me as soon as possible
I know this is kind of old and outdated, but I wanted to put in my 2c here and tell others what 'worked' for me. Its a workaround for sure. I didn't want the entire themecraft plugin, I simply needed orders and view orders to work with my buddypress integration so this was a great starting point.
To change the view order url you need to use the filter.. here's an example of how that would look
add_filter( 'woocommerce_get_view_order_url', 'view_order_url', 10, 2 );
public function view_order_url( $view_order_url, $order ) {
$current_user = wp_get_current_user();
return wc_get_endpoint_url( 'view-order', $order->get_id(), '/members/' . $current_user->user_nicename . '/account/');
}
then you need to add another sub-tab inside of the bp_navigation()
function which creates the nav items for the woocommerce area. An example:
bp_core_new_subnav_item(
array(
'name' => __( 'View Order', 'buddypress' ),
'slug' => 'view-order',
'parent_url' => trailingslashit( $bp->loggedin_user->domain . 'account' ),
'parent_slug' => 'account',
'screen_function' => array( $this, 'account_screens' ),
'show_for_displayed_user' => false,
'user_has_access' => bp_is_my_profile(),
'position' => 100,
'item_css_id' => 'account-view_order',
)
);
Now unfortunately this will add an extra tab in the sub-nav area, so you will see Dashboard, orders, view order, etc, etc
in the sub menu. I wasn't able to figure out how to create this subpage and also hide it from the nav. Maybe someone else can pickup my slack where I fell short, but for the time being I simply used the item_css_id to target that menu item and use display:none;
to hide it from the user.
This is my 2c, hopefully it will lead someone in the right direction.
This worked perfect for me ♥, is there any possibility to do the same for the woocommerce membership plugin?
If you need the plugin I can send it to you without any problem