Dokan Hooks Reference
Developer documentation for customizing BuddyX Pro’s Dokan integration.
Action Hooks
Section titled “Action Hooks”buddyx_store_container_open
Section titled “buddyx_store_container_open”Opens the container wrapper for store pages.
add_action( 'buddyx_store_container_open', 'my_store_container_open', 5 );
function my_store_container_open() { echo '<div class="my-custom-wrapper">';}Default behavior: Outputs <div class="container">
Priority: 10
buddyx_store_container_close
Section titled “buddyx_store_container_close”Closes the container wrapper for store pages.
add_action( 'buddyx_store_container_close', 'my_store_container_close', 15 );
function my_store_container_close() { echo '</div><!-- .my-custom-wrapper -->';}Default behavior: Outputs </div>
Priority: 10
dokan_store_profile_frame_after
Section titled “dokan_store_profile_frame_after”Dokan action hook - BuddyX Pro templates trigger this after the store header.
add_action( 'dokan_store_profile_frame_after', 'my_after_store_header', 10, 2 );
function my_after_store_header( $store_user_data, $store_info ) { // Add content after store header echo '<div class="store-announcement">'; echo 'Free shipping on orders over $50!'; echo '</div>';}Parameters:
$store_user_data(object) - Vendor user data$store_info(array) - Store information array
Theme Functions
Section titled “Theme Functions”buddyx_store_container_open()
Section titled “buddyx_store_container_open()”Outputs the opening container div for store pages.
// Override in child themefunction buddyx_store_container_open() { ?> <div class="container wide-container"> <?php}Usage: Called via action hook, typically in store templates.
buddyx_store_container_close()
Section titled “buddyx_store_container_close()”Outputs the closing container div for store pages.
// Override in child themefunction buddyx_store_container_close() { ?> </div><!-- .wide-container --> <?php}render_store_header_on_top()
Section titled “render_store_header_on_top()”Renders the store header in the “top” position.
// Check header position and render$position = get_theme_mod( 'store_header_position', 'top' );if ( 'top' === $position ) { render_store_header_on_top();}Output:
<div class="dokan-single-store dokan-single-store-top"> <div class="store-page-wrap" role="main"> <!-- Store header template --> </div></div>Customizer Settings
Section titled “Customizer Settings”Getting Customizer Values
Section titled “Getting Customizer Values”// Store header position$position = get_theme_mod( 'store_header_position', 'top' );// Values: 'top' or 'inner'
// Store layout (sidebar position)$layout = get_theme_mod( 'store_layout', 'left' );// Values: 'left' or 'right'Template Variables
Section titled “Template Variables”Store Page (store.php)
Section titled “Store Page (store.php)”| Variable | Type | Description |
|---|---|---|
$store_user |
object | Dokan vendor object |
$store_info |
array | Store information |
$map_location |
string | Store location |
$layout |
string | Sidebar layout |
$position |
string | Header position |
// Example: Access store user in template$store_user = dokan()->vendor->get( get_query_var( 'author' ) );$store_name = $store_user->get_shop_name();$store_url = $store_user->get_shop_url();CSS Classes
Section titled “CSS Classes”Store Layout Classes
Section titled “Store Layout Classes”| Class | Applied When |
|---|---|
.layout-left |
Left sidebar layout |
.layout-right |
Right sidebar layout |
.dokan-single-store |
Main store container |
.dokan-single-store-top |
Store header at top |
Container Classes
Section titled “Container Classes”| Class | Element |
|---|---|
.container |
Main container wrapper |
.dokan-store-wrap |
Store content wrapper |
.store-page-wrap |
Store page inner wrapper |
Template Overrides
Section titled “Template Overrides”Available Templates
Section titled “Available Templates”Override these templates in your child theme:
child-theme/dokan/├── store.php # Main store page├── store-sidebar.php # Store sidebar├── store-toc.php # Table of contents├── store-reviews.php # Store reviews└── vendor-biography.php # Vendor biographyOverride Example
Section titled “Override Example”Child theme: dokan/store.php
<?php/** * Custom store template */
$store_user = dokan()->vendor->get( get_query_var( 'author' ) );$store_info = $store_user->get_shop_info();
get_header( 'shop' );
// Your custom store layout here
get_footer( 'shop' );Removing Theme Modifications
Section titled “Removing Theme Modifications”Use Default Store Container
Section titled “Use Default Store Container”// Remove theme containerremove_action( 'buddyx_store_container_open', 'buddyx_store_container_open' );remove_action( 'buddyx_store_container_close', 'buddyx_store_container_close' );
// Add your ownadd_action( 'buddyx_store_container_open', function() { echo '<div class="my-container">';});
add_action( 'buddyx_store_container_close', function() { echo '</div>';});Dokan API Reference
Section titled “Dokan API Reference”Get Vendor Object
Section titled “Get Vendor Object”// By author query var (on store page)$vendor = dokan()->vendor->get( get_query_var( 'author' ) );
// By user ID$vendor = dokan()->vendor->get( $user_id );Vendor Methods
Section titled “Vendor Methods”$vendor->get_shop_name(); // Store name$vendor->get_shop_url(); // Store URL$vendor->get_shop_info(); // All store info array$vendor->get_location(); // Store location$vendor->get_banner(); // Banner URL$vendor->get_gravatar(); // Avatar URL$vendor->is_featured(); // Is featured vendor$vendor->get_rating(); // Store ratingWooCommerce Hooks Used
Section titled “WooCommerce Hooks Used”The store template uses these WooCommerce hooks:
// Before main contentdo_action( 'woocommerce_before_main_content' );
// Product loopwoocommerce_product_loop_start();wc_get_template_part( 'content', 'product' );woocommerce_product_loop_end();
// After main contentdo_action( 'woocommerce_after_main_content' );Yoast SEO Integration
Section titled “Yoast SEO Integration”The store template supports Yoast breadcrumbs:
if ( function_exists( 'yoast_breadcrumb' ) ) { yoast_breadcrumb( '<p id="breadcrumbs">', '</p>' );}Related Documentation
Section titled “Related Documentation”- README - Technical overview
- Customer Guide - Setup instructions
- WooCommerce Hooks - WooCommerce customization
- Developer Hooks - All theme hooks

