Skip to content

Instantly share code, notes, and snippets.

@rashedripon
Last active July 1, 2020 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rashedripon/e9f0638b1d0e734e0221714aa44f1d6b to your computer and use it in GitHub Desktop.
Save rashedripon/e9f0638b1d0e734e0221714aa44f1d6b to your computer and use it in GitHub Desktop.
Add store open/close notice on Dokan vendor's order page
add_action('dokan_order_content_inside_before', function() {
$seller_id = dokan_get_current_user_id();
var_dump($seller_id);
global $wp;
$current_url = home_url();
$store_settings_page = $current_url . "/dashboard/settings/store";
?>
<div class="dokan-store-open-close" style="display: block; margin-bottom: 20px; font-weight: bold;">
<?php if ( dokan_is_store_open( $seller_id ) ) {
?>
<span style="background: #d4edda; border: #c3e6cb; color: #155724; display: block; padding: 20px 30px;">
Your store is open, now you can sell! To close your store visit <a href="<?php echo $store_settings_page ?>" class="dokan-btn dokan-btn-theme">Store settings</a>
</span>
<?php
} else {
?>
<span style="background: #f8d7da; border: #f5c6cb; color: #721c24; display: block; padding: 20px 30px;">
Your store is closed, Open your store to start selling! To open your store visit <a href="<?php echo $store_settings_page ?>" class="dokan-btn dokan-btn-theme">Store settings</a>
</span>
<?php
} ?>
</div>
<?php
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment