Skip to content

Commit

Permalink
Merge branch 'release/2.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed Jun 8, 2017
2 parents f122d08 + c6a811a commit d161016
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 90 deletions.
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v2.6.3 -> June 08, 2017
---------------------
- [fix] Missing text domains updated
- [fix] Featured Seller, Best Seller and Top Seller query fixed for older version of WooCommerce
- [fix] Translation issue fixed on withdraw template
- [fix] Store pages template conflitcs with theme home page
- [tweak] Various other code improvements

v2.6.2 -> May 18, 2017
---------------------
- [new] Dynamic state select option for Vendor Setup Wizard
Expand Down
6 changes: 3 additions & 3 deletions classes/template-products.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function handle_all_submit() {
if ( $date_to && ! $date_from ) {
update_post_meta( $product_id, '_sale_price_dates_from', strtotime( 'NOW', current_time( 'timestamp' ) ) );
}

if ( '' !== $_POST['_sale_price'] && '' == $date_to && '' == $date_from ) {
update_post_meta( $product_id, '_price', wc_format_decimal( $_POST['_sale_price'] ) );
} else {
Expand Down Expand Up @@ -266,14 +266,14 @@ function handle_all_submit() {
self::$errors = apply_filters( 'dokan_can_edit_product', $errors );

if ( !self::$errors ) {
$product_info = array(
$product_info = apply_filters( 'dokan_update_product_post_data', array(
'ID' => $post_id,
'post_title' => sanitize_text_field( $_POST['post_title'] ),
'post_content' => $_POST['post_content'],
'post_excerpt' => $_POST['post_excerpt'],
'post_status' => isset( $_POST['post_status'] ) ? $_POST['post_status'] : 'pending',
'comment_status' => isset( $_POST['_enable_reviews'] ) ? 'open' : 'closed'
);
) );

wp_update_post( $product_info );

Expand Down
6 changes: 3 additions & 3 deletions classes/template-withdraw.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ public function show_seller_balance() {
$withdraw_limit = dokan_get_option( 'withdraw_limit', 'dokan_withdraw', -1 );
$threshold = dokan_get_option( 'withdraw_date_limit', 'dokan_withdraw', -1 );

$message = sprintf( __('Current Balance: %s '), $balance );
$message = sprintf( __('Current Balance: %s ', 'dokan-lite' ), $balance );

if ( $withdraw_limit != -1 ) {
$message .= sprintf( __('<br>Minimum Withdraw amount: %s '), wc_price( $withdraw_limit ) );
$message .= sprintf( __( '<br>Minimum Withdraw amount: %s ', 'dokan-lite' ), wc_price( $withdraw_limit ) );
}
if ( $threshold != -1 ) {
$message .= sprintf( __('<br>Withdraw Threshold: %d days '), $threshold );
$message .= sprintf( __( '<br>Withdraw Threshold: %d days ', 'dokan-lite' ), $threshold );
}

dokan_get_template_part( 'global/dokan-warning', '', array( 'message' => $message, 'deleted' => false ) );
Expand Down
4 changes: 2 additions & 2 deletions dokan.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Dokan (Lite) - Multi-vendor Marketplace
Plugin URI: https://wordpress.org/plugins/dokan-lite/
Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
Version: 2.6.2
Version: 2.6.3
Author: Tareq Hasan
Author URI: http://tareq.co/
Text Domain: dokan-lite
Expand Down Expand Up @@ -45,7 +45,7 @@
define( '__DIR__', dirname( __FILE__ ) );
}

define( 'DOKAN_PLUGIN_VERSION', '2.6.2' );
define( 'DOKAN_PLUGIN_VERSION', '2.6.3' );
define( 'DOKAN_FILE', __FILE__ );
define( 'DOKAN_DIR', __DIR__ );
define( 'DOKAN_INC_DIR', __DIR__ . '/includes' );
Expand Down
11 changes: 10 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1820,4 +1820,13 @@ function dokan_is_valid_owner( $post_id, $user_id ) {
return true;

return false;
}
}

add_action( 'wp', 'dokan_set_is_home_false_on_store' );

function dokan_set_is_home_false_on_store() {
global $wp_query;
if ( dokan_is_store_page() ) {
$wp_query->is_home = false;
}
}
2 changes: 1 addition & 1 deletion includes/product-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function dokan_save_product( $args ) {
'post_title' => sanitize_text_field( $data['post_title'] ),
'post_content' => $data['post_content'],
'post_excerpt' => $data['post_excerpt'],
) );
), $data );

$product_id = wp_insert_post( $post_data );

Expand Down
7 changes: 6 additions & 1 deletion includes/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,19 @@ function dokan_page_navi( $before = '', $after = '', $wp_query ) {
function dokan_product_dashboard_errors() {
$type = isset( $_GET['message'] ) ? $_GET['message'] : '';

switch ($type) {
switch ( $type ) {
case 'product_deleted':
dokan_get_template_part( 'global/dokan-success', '', array( 'deleted' => true, 'message' => __( 'Product succesfully deleted', 'dokan-lite' ) ) );
break;

case 'error':
dokan_get_template_part( 'global/dokan-error', '', array( 'deleted' => false, 'message' => __( 'Something went wrong!', 'dokan-lite' ) ) );
break;

default:
do_action( 'dokan_product_dashboard_errors', $type );
break;

}
}

Expand Down
14 changes: 10 additions & 4 deletions includes/wc-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ function dokan_seller_displayname ( $display_name ) {
* @return \WP_Query
*/
function dokan_get_featured_products( $per_page = 9) {
$product_visibility_term_ids = wc_get_product_visibility_term_ids();


$args = array(
'posts_per_page' => $per_page,
Expand All @@ -586,6 +586,7 @@ function dokan_get_featured_products( $per_page = 9) {
);

if ( version_compare( WC_VERSION, '2.7', '>' ) ) {
$product_visibility_term_ids = wc_get_product_visibility_term_ids();
$args['tax_query'][] = array(
'taxonomy' => 'product_visibility',
'field' => 'term_taxonomy_id',
Expand Down Expand Up @@ -626,7 +627,6 @@ function dokan_get_featured_products( $per_page = 9) {
* @return \WP_Query
*/
function dokan_get_latest_products( $per_page = 9 , $seller_id = '' ) {
$product_visibility_term_ids = wc_get_product_visibility_term_ids();

$args = array(
'posts_per_page' => $per_page,
Expand All @@ -635,6 +635,9 @@ function dokan_get_latest_products( $per_page = 9 , $seller_id = '' ) {
);

if ( version_compare( WC_VERSION, '2.7', '>' ) ) {

$product_visibility_term_ids = wc_get_product_visibility_term_ids();

$args['tax_query'] = array(
'taxonomy' => 'product_visibility',
'field' => 'term_taxonomy_id',
Expand Down Expand Up @@ -669,7 +672,6 @@ function dokan_get_latest_products( $per_page = 9 , $seller_id = '' ) {
* @return \WP_Query
*/
function dokan_get_best_selling_products( $per_page = 8, $seller_id = '' ) {
$product_visibility_term_ids = wc_get_product_visibility_term_ids();

$args = array(
'post_type' => 'product',
Expand All @@ -681,6 +683,8 @@ function dokan_get_best_selling_products( $per_page = 8, $seller_id = '' ) {
);

if ( version_compare( WC_VERSION, '2.7', '>' ) ) {

$product_visibility_term_ids = wc_get_product_visibility_term_ids();
$args['tax_query'] = array(
'taxonomy' => 'product_visibility',
'field' => 'term_taxonomy_id',
Expand Down Expand Up @@ -733,7 +737,6 @@ function check_more_seller_product_tab( ) {
* @return \WP_Query
*/
function dokan_get_top_rated_products( $per_page = 8 , $seller_id = '') {
$product_visibility_term_ids = wc_get_product_visibility_term_ids();

$args = array(
'post_type' => 'product',
Expand All @@ -743,6 +746,9 @@ function dokan_get_top_rated_products( $per_page = 8 , $seller_id = '') {
);

if ( version_compare( WC_VERSION, '2.7', '>' ) ) {

$product_visibility_term_ids = wc_get_product_visibility_term_ids();

$args['tax_query'] = array(
'taxonomy' => 'product_visibility',
'field' => 'term_taxonomy_id',
Expand Down
Loading

0 comments on commit d161016

Please sign in to comment.