Skip to content

Commit

Permalink
Release Version 3.10.2
Browse files Browse the repository at this point in the history
Merge branch 'release/3.10.2'
  • Loading branch information
shohag121 committed Apr 2, 2024
2 parents 82bcea8 + b01d0f5 commit 0d3e2ef
Show file tree
Hide file tree
Showing 51 changed files with 1,224 additions and 858 deletions.
18 changes: 14 additions & 4 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.3
**Tested up to:** 6.5
**WC requires at least:** 5.0.0
**WC tested up to:** 8.6.1
**WC tested up to:** 8.7.0
**Requires PHP:** 7.4
**Stable tag:** 3.10.1
**Stable tag:** 3.10.2
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##

### v3.10.2 ( Apr 01, 2024 ) ###

- **update:** Email placeholder, additional content support and formatting added
- **update:** Add requires plugin header for dokan so that required plugin check can be initiated.
- **update:** dokan_commission_log_gateway_fee_to_order_note filter hook added
- **fix:** Vendor profile progress bar doesn't update if the address is filled from the vendor registration form
- **fix:** Color synchronization issue in vendor dashboard order notes
- **fix:** product review email cannot be disabled without also disabling Contact Vendor email
- **fix:** Order Export to CSV on the filtered list not working

### v3.10.1 ( Mar 18, 2024 ) ###

- **update:** Update Categories Easily from Vendor Edit Page
Expand Down Expand Up @@ -1452,7 +1462,7 @@ v2.9.14 -> Apr 26, 2019
- **Fix:** Schedule product price not showing correctly
- **Fix:** Backward compatibility for banner and store time

For the changelog history, view the full [changelog.txt](https://github.com/weDevsOfficial/dokan/blob/develop/changelog.txt).
For the changelog history, view the full [changelog.txt](https://raw.githubusercontent.com/getdokan/dokan/develop/CHANGELOG.md).

## Upgrade Notice ##

Expand Down
22 changes: 11 additions & 11 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,9 @@ a.dokan-btn-theme .badge,
input[type='submit'].dokan-btn-success,
a.dokan-btn-success,
.dokan-btn-success {
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
color: #fff !important;
background-color: #5cb85c !important;
border-color: #4cae4c !important;
}
input[type='submit'].dokan-btn-success:hover,
a.dokan-btn-success:hover,
Expand All @@ -731,9 +731,9 @@ a.dokan-btn-success.active,
.open .dropdown-toggleinput[type='submit'].dokan-btn-success,
.open .dropdown-togglea.dokan-btn-success,
.open .dropdown-toggle.dokan-btn-success {
color: #fff;
background-color: #47a447;
border-color: #398439;
color: #fff !important;
background-color: #47a447 !important;
border-color: #398439 !important;
}
input[type='submit'].dokan-btn-success:active,
a.dokan-btn-success:active,
Expand All @@ -744,7 +744,7 @@ a.dokan-btn-success.active,
.open .dropdown-toggleinput[type='submit'].dokan-btn-success,
.open .dropdown-togglea.dokan-btn-success,
.open .dropdown-toggle.dokan-btn-success {
background-image: none;
background-image: none !important;
}
input[type='submit'].dokan-btn-success.disabled,
a.dokan-btn-success.disabled,
Expand Down Expand Up @@ -791,14 +791,14 @@ a.dokan-btn-success[disabled].active,
fieldset[disabled] input[type='submit'].dokan-btn-success.active,
fieldset[disabled] a.dokan-btn-success.active,
fieldset[disabled] .dokan-btn-success.active {
background-color: #80c780;
border-color: #6ec06e;
background-color: #80c780 !important;
border-color: #6ec06e !important;
}
input[type='submit'].dokan-btn-success .badge,
a.dokan-btn-success .badge,
.dokan-btn-success .badge {
color: #5cb85c;
background-color: #fff;
color: #5cb85c !important;
background-color: #fff !important;
}
input[type='submit'].dokan-btn-default,
a.dokan-btn-default,
Expand Down
2 changes: 1 addition & 1 deletion assets/src/less/extra.less
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ a.dokan-btn-theme,
input[type='submit'].dokan-btn-success,
a.dokan-btn-success,
.dokan-btn-success {
.button-variant(#fff; @brand-success; darken(@brand-success, 5%));
.button-variant(#fff; @brand-success; darken(@brand-success, 5%)) !important;
}

input[type='submit'].dokan-btn-default,
Expand Down
8 changes: 5 additions & 3 deletions dokan.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
* Plugin Name: Dokan
* Plugin URI: https://dokan.co/wordpress/
* Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
* Version: 3.10.1
* Version: 3.10.2
* Author: weDevs
* Author URI: https://dokan.co/
* Text Domain: dokan-lite
* Requires Plugins: woocommerce
* WC requires at least: 5.0.0
* WC tested up to: 8.6.1
* WC tested up to: 8.7.0
* Domain Path: /languages/
* License: GPL2
*/
Expand Down Expand Up @@ -56,6 +57,7 @@
* @property WeDevs\Dokan\BackgroundProcess\Manager $bg_process Instance of WeDevs\Dokan\BackgroundProcess\Manager class
* @property WeDevs\Dokan\Withdraw\Manager $withdraw Instance of WeDevs\Dokan\Withdraw\Manager class
* @property WeDevs\Dokan\Frontend\Frontend $frontend_manager Instance of \WeDevs\Dokan\Frontend\Frontend class
* @property WeDevs\Dokan\Registration $registration Instance of WeDevs\Dokan\Registration class
*/
final class WeDevs_Dokan {

Expand All @@ -64,7 +66,7 @@ final class WeDevs_Dokan {
*
* @var string
*/
public $version = '3.10.1';
public $version = '3.10.2';

/**
* Instance of self
Expand Down
6 changes: 4 additions & 2 deletions includes/Commission.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ public function calculate_gateway_fee( $order_id ) {

$tmp_order->update_meta_data( 'dokan_gateway_fee', $gateway_fee );
$tmp_order->save();
// translators: %s: Geteway fee
$tmp_order->add_order_note( sprintf( __( 'Payment gateway processing fee %s', 'dokan-lite' ), wc_format_decimal( $gateway_fee, 2 ) ) );

if ( apply_filters( 'dokan_commission_log_gateway_fee_to_order_note', true, $tmp_order ) ) {
// translators: %s: Geteway fee
$tmp_order->add_order_note( sprintf( __( 'Payment gateway processing fee %s', 'dokan-lite' ), wc_format_decimal( $gateway_fee, 2 ) ) );
}
//remove cache for seller earning
$cache_key = "get_earning_from_order_table_{$tmp_order->get_id()}_seller";
Cache::delete( $cache_key );
Expand Down
4 changes: 3 additions & 1 deletion includes/Dashboard/Templates/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ public function handle_order_export() {
$order_status = isset( $_POST['order_status'] ) ? sanitize_text_field( wp_unslash( $_POST['order_status'] ) ) : 'all';
$search = isset( $_POST['search'] ) ? sanitize_text_field( wp_unslash( $_POST['search'] ) ) : '';

$query_args['customer_id'] = $customer_id;
if ( $customer_id ) {
$query_args['customer_id'] = $customer_id;
}
$query_args['status'] = $order_status;
$query_args['date']['from'] = $order_date_start;
$query_args['date']['to'] = $order_date_end;
Expand Down
103 changes: 56 additions & 47 deletions includes/Emails/ContactSeller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace WeDevs\Dokan\Emails;

use WC_Email;
use WeDevs\Dokan\Vendor\Vendor;

/**
* Customer Email to vendor from contact form widget.
Expand All @@ -27,12 +28,21 @@ class ContactSeller extends WC_Email {
* Constructor.
*/
public function __construct() {
$this->id = 'dokan_contact_seller';
$this->title = __( 'Dokan Contact Vendor', 'dokan-lite' );
$this->description = __( 'These emails are sent to a vendor who is contacted by customer via contact form widget ', 'dokan-lite' );
$this->template_html = 'emails/contact-seller.php';
$this->template_plain = 'emails/plain/contact-seller.php';
$this->template_base = DOKAN_DIR . '/templates/';
$this->id = 'dokan_contact_seller';
$this->title = __( 'Dokan Contact Vendor', 'dokan-lite' );
$this->description = __( 'These emails are sent to a vendor who is contacted by customer via contact form widget ', 'dokan-lite' );
$this->template_html = 'emails/contact-seller.php';
$this->template_plain = 'emails/plain/contact-seller.php';
$this->template_base = DOKAN_DIR . '/templates/';
$this->placeholders = [
'{store_name}' => '',
'{customer_name}' => '',
'{customer_email}' => '',
'{message}' => '',
// only for backward compatibility
'{site_name}' => $this->get_from_name(),
'{seller_name}' => '',
];

// Triggers for this email
add_action( 'dokan_trigger_contact_seller_mail', array( $this, 'trigger' ), 30, 4 );
Expand All @@ -51,7 +61,7 @@ public function __construct() {
* @return string
*/
public function get_default_subject() {
return __( '[{customer_name}] sent you a message from your store at - {site_name}', 'dokan-lite' );
return __( '[{customer_name}] sent you a message from your store at - {site_title}', 'dokan-lite' );
}

/**
Expand All @@ -61,45 +71,35 @@ public function get_default_subject() {
* @return string
*/
public function get_default_heading() {
return __( '{customer_name} - Sent a message from {site_name}', 'dokan-lite' );
return __( '{customer_name} - Sent a message from {site_title}', 'dokan-lite' );
}

/**
* Trigger the this email.
* Trigger this email.
*/
public function trigger( $seller_email, $contact_name, $contact_email, $contact_message ) {
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
return;
}
$this->setup_locale();

$this->from_email = $contact_email;

$seller = get_user_by( 'email', $seller_email );
$seller = new Vendor( $seller );

$this->find['seller_name'] = '{seller_name}';
$this->find['customer_name'] = '{customer_name}';
$this->find['customer_email'] = '{customer_email}';
$this->find['message'] = '{message}';
$this->find['site_name'] = '{site_name}';
$this->find['site_url'] = '{site_url}';

$this->replace['seller_name'] = $seller->display_name;
$this->replace['customer_name'] = $contact_name;
$this->replace['customer_email'] = $contact_email;
$this->replace['message'] = $contact_message;
$this->replace['site_name'] = $this->get_from_name();
$this->replace['site_url'] = site_url();

$this->setup_locale();
$this->placeholders['{store_name}'] = $seller->get_shop_name();
$this->placeholders['{customer_name}'] = $contact_name;
$this->placeholders['{customer_email}'] = $contact_email;
$this->placeholders['{message}'] = $contact_message;
$this->placeholders['{seller_name}'] = $seller->get_shop_name(); // only for backward compatibility.
$this->send( $seller_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
$this->restore_locale();
}

/**
* Get the from address for outgoing emails.
*
* @since DOKAN_LITE_SINCE
*
* @return string
*/
public function get_from_address( $from_email = '' ) {
Expand All @@ -113,17 +113,16 @@ public function get_from_address( $from_email = '' ) {
* @return string
*/
public function get_content_html() {
ob_start();
wc_get_template(
return wc_get_template_html(
$this->template_html, array(
'email_heading' => $this->get_heading(),
'sent_to_admin' => true,
'plain_text' => false,
'email' => $this,
'data' => $this->replace,
'email_heading' => $this->get_heading(),
'additional_content' => $this->get_additional_content(),
'sent_to_admin' => true,
'plain_text' => false,
'email' => $this,
'data' => $this->placeholders,
), 'dokan/', $this->template_base
);
return ob_get_clean();
}

/**
Expand All @@ -133,23 +132,26 @@ public function get_content_html() {
* @return string
*/
public function get_content_plain() {
ob_start();
wc_get_template(
$this->template_html, array(
'email_heading' => $this->get_heading(),
'sent_to_admin' => true,
'plain_text' => true,
'email' => $this,
'data' => $this->replace,
return wc_get_template_html(
$this->template_plain, array(
'email_heading' => $this->get_heading(),
'additional_content' => $this->get_additional_content(),
'sent_to_admin' => true,
'plain_text' => true,
'email' => $this,
'data' => $this->placeholders,
), 'dokan/', $this->template_base
);
return ob_get_clean();
}

/**
* Initialize settings form fields.
*/
public function init_form_fields() {
$placeholders = $this->placeholders;
unset( $placeholders['{site_name}'], $placeholders['{seller_name}'] );
/* translators: %s: list of placeholders */
$placeholder_text = sprintf( __( 'Available placeholders: %s', 'dokan-lite' ), '<code>' . implode( '</code>, <code>', array_keys( $placeholders ) ) . '</code>' );
$this->form_fields = array(
'enabled' => array(
'title' => __( 'Enable/Disable', 'dokan-lite' ),
Expand All @@ -162,20 +164,27 @@ public function init_form_fields() {
'title' => __( 'Subject', 'dokan-lite' ),
'type' => 'text',
'desc_tip' => true,
/* translators: %s: list of placeholders */
'description' => sprintf( __( 'Available placeholders: %s', 'dokan-lite' ), '<code>{seller_name}, {customer_name}, {site_name}</code>' ),
'description' => $placeholder_text,
'placeholder' => $this->get_default_subject(),
'default' => '',
),
'heading' => array(
'title' => __( 'Email heading', 'dokan-lite' ),
'type' => 'text',
'desc_tip' => true,
/* translators: %s: list of placeholders */
'description' => sprintf( __( 'Available placeholders: %s', 'dokan-lite' ), '<code>{seller_name}, {customer_name}, {site_name}</code>' ),
'description' => $placeholder_text,
'placeholder' => $this->get_default_heading(),
'default' => '',
),
'additional_content' => array(
'title' => __( 'Additional content', 'dokan-lite' ),
'description' => __( 'Text to appear below the main email content.', 'dokan-lite' ) . ' ' . $placeholder_text,
'css' => 'width:400px; height: 75px;',
'placeholder' => __( 'N/A', 'dokan-lite' ),
'type' => 'textarea',
'default' => $this->get_default_additional_content(),
'desc_tip' => true,
),
'email_type' => array(
'title' => __( 'Email type', 'dokan-lite' ),
'type' => 'select',
Expand Down
3 changes: 3 additions & 0 deletions includes/Emails/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public function set_email_template_directory( $template_dir, $template ) {
'withdraw-approve.php',
'vendor-new-order.php',
'vendor-completed-order.php',
'reverse-withdrawal-invoice.php',
)
);

Expand Down Expand Up @@ -154,6 +155,8 @@ public function register_email_actions( $actions ) {
'dokan_withdraw_request_cancelled',
'dokan_pending_product_published_notification',
'dokan_trigger_contact_seller_mail',
'dokan_reverse_withdrawal_invoice_email_sent',
'woocommerce_order_status_completed_notification',
'wp_set_comment_status',
'comment_post',
)
Expand Down
Loading

0 comments on commit 0d3e2ef

Please sign in to comment.