Tagged: buddycommerce
We have an existing plugin for WooCommerce which registers a custom endpoint to show a screen within the MyAccount area.
When using BuddyPress with BuddyCommerce, the URLs change for orders, subscriptions, etc except ours.
Does anyone have code to re-register the endpoint so it can be used in BuddyPress?
Hi The WP Makers,
Welcome to BuddyDev support forums.The handling of an end point has 4 steps:-
1. Registering the end point as one of the BuddyPress tabs (create nav/sub nav on bp_setup_nav).
2. Tuning environment on that page to behave like mapped WooCommerece page(may need updating some query variables)
3. Showing the content by adding Woocommerce shortcode on that page.4. If the shortcode contains some form, you will need to add a handler for the submitted content.
I will link to the code showing these steps.
1. Here is the code showing the nav registratons.
https://github.com/buddydev/buddycommerce/blob/master/src/core/users/handlers/class-bc-tabs-helper.php2. Here is an example showing how we tell WooCommerec which screen it is
https://github.com/buddydev/buddycommerce/blob/master/src/core/users/handlers/class-bc-address-screen-handler.php3. Here is a class implementing the screen functions used in the previous step
https://github.com/buddydev/buddycommerce/blob/master/src/core/users/class-bc-screens.phpI hope that helps.
Regards
Brajesh
You must be logged in to reply to this topic.