Skip to content

Commit

Permalink
Merge branch 'develop' into update/email-rafactors
Browse files Browse the repository at this point in the history
  • Loading branch information
shohag121 committed Dec 28, 2023
2 parents 040a00b + c3ccbe2 commit 8cb8859
Show file tree
Hide file tree
Showing 34 changed files with 686 additions and 400 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
**Donate Link:** http://tareq.co/donate/
**Tags:** WooCommerce multivendor marketplace, multi vendor marketplace, multi seller store, multi-vendor, multi seller, commissions, multivendor, marketplace, product vendors, woocommerce vendor, commission rate, e-commerce, woocommerce, ebay, ecommerce.
**Requires at least:** 5.6
**Tested up to:** 6.4.1
**Tested up to:** 6.4.2
**WC requires at least:** 5.0.0
**WC tested up to:** 8.2.2
**Requires PHP:** 7.3
**Stable tag:** 3.9.2
**Stable tag:** 3.9.4
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -338,7 +338,16 @@ A. Just install and activate the PRO version without deleting the free plugin. A

## Changelog ##

### v3.9.2 ( Nov 10, 2023 ) ###
### v3.9.4 ( Dec 12, 2023 ) ###

**fix:** Fixed an issue where the Vendor class shop_data persistence is broken on save()
**fix:** Fixed a fatal error while trying to edit a subscription under WordPress Admin Panel → WooCommerce → Subscription menu of the WooCommerce Subscription Plugin.

### v3.9.3 ( Nov 30, 2023 ) ###

- **fix:** Fixed an issue where the Tab fields under the product Add/Edit page don’t display predefined tags until users start typing to select tags.

### v3.9.2 ( Nov 13, 2023 ) ###

- **new:** A new email template has been introduced named Dokan Vendor Product Review. After a product has been reviewed, an email containing information about the review is sent to the vendor. The email includes details such as the reviewer’s name, product name, review rating, and text. The email also contains a link to the review page where the vendor can view the review and respond if necessary.
- **update:** Display a non-purchasable notice for the vendor’s own products.
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dokan.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/vue-admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/vue-bootstrap.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/src/js/product-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@

if ( ! $found ) data.unshift( tag );
},
minimumInputLength: 2,
minimumInputLength: 0,
maximumSelectionLength: dokan.maximum_tags_select_length !== undefined ? dokan.maximum_tags_select_length : -1,
ajax: {
url: dokan.ajaxurl,
Expand Down
71 changes: 37 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions dokan.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Dokan
* Plugin URI: https://dokan.co/wordpress/
* Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
* Version: 3.9.2
* Version: 3.9.4
* Author: weDevs
* Author URI: https://dokan.co/
* Text Domain: dokan-lite
Expand Down Expand Up @@ -63,7 +63,7 @@ final class WeDevs_Dokan {
*
* @var string
*/
public $version = '3.9.2';
public $version = '3.9.4';

/**
* Instance of self
Expand Down Expand Up @@ -111,7 +111,7 @@ private function __construct() {
register_activation_hook( __FILE__, [ $this, 'activate' ] );
register_deactivation_hook( __FILE__, [ $this, 'deactivate' ] );

add_action( 'before_woocommerce_init', [ $this, 'add_hpos_support' ] );
add_action( 'before_woocommerce_init', [ $this, 'declare_woocommerce_feature_compatibility' ] );
add_action( 'woocommerce_loaded', [ $this, 'init_plugin' ] );
add_action( 'woocommerce_flush_rewrite_rules', [ $this, 'flush_rewrite_rules' ] );

Expand Down Expand Up @@ -287,9 +287,10 @@ private function define( $name, $value ) {
*
* @return void
*/
public function add_hpos_support() {
public function declare_woocommerce_feature_compatibility() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, false );
}
}

Expand Down
30 changes: 30 additions & 0 deletions includes/Admin/Notices/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public static function dokan_get_promo_notices() {
continue;
}

if ( isset( $promo['lite_only'] ) && wc_string_to_bool( $promo['lite_only'] ) && self::is_pro_license_active() ) {
continue;
}

if ( $est_time_now >= $promo['start_date'] && $est_time_now <= $promo['end_date'] ) {
$notices[] = [
'type' => 'promotion',
Expand Down Expand Up @@ -100,6 +104,32 @@ public static function dokan_get_promo_notices() {
return array_values( $notices );
}

/**
* Check if dokan pro-license is active
*
* @since 3.9.3
*
* @return bool
*/
public static function is_pro_license_active(): bool {
if ( ! dokan()->is_pro_exists() ) {
return false;
}

if ( ! property_exists( dokan_pro(), 'license' ) ) {
// this is old version of dokan pro
return false;
}

$license = dokan_pro()->license->plugin_update_message();
if ( ! empty( $license ) ) {
// if the plugin update message is not empty, then the license is not active
return false;
}

return true;
}

/**
* Check has new version in dokan lite and pro
*
Expand Down
10 changes: 9 additions & 1 deletion includes/Order/Admin/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function admin_shop_order_row_classes( $classes, $class, $post_id ) {
return $classes;
}

if ( is_search() || ! current_user_can( 'manage_woocommerce' ) ) {
if ( ! is_admin() || ! current_user_can( 'manage_woocommerce' ) ) {
return $classes;
}

Expand Down Expand Up @@ -211,6 +211,14 @@ public function admin_shop_order_row_classes( $classes, $class, $post_id ) {
* @return void
*/
public function admin_shop_order_scripts() {
$current_screen = get_current_screen();
if ( ! $current_screen ) {
return;
}

if ( ( 'edit' === $current_screen->base && 'shop_order' !== $current_screen->post_type ) && OrderUtil::get_order_admin_screen() !== $current_screen->base ) {
return;
}
?>
<script type="text/javascript">
jQuery(function ($) {
Expand Down
3 changes: 3 additions & 0 deletions includes/Order/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ function dokan_sync_insert_order( $order_id ) {
global $wpdb;

$order = wc_get_order( $order_id );
if ( ! $order || $order instanceof WC_Subscription ) {
return;
}

if ( dokan()->order->is_order_already_synced( $order ) ) {
return;
Expand Down
Loading

0 comments on commit 8cb8859

Please sign in to comment.