Skip to content

Commit

Permalink
Merge branch 'release/3.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
nurul-umbhiya committed Oct 27, 2022
2 parents f08cb04 + 8e8a09e commit ace5c09
Show file tree
Hide file tree
Showing 47 changed files with 1,096 additions and 355 deletions.
4 changes: 3 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = function(grunt) {
],
'<%= dirs.css %>/reverse-withdrawal.css': ['<%= dirs.devLessSrc %>/reverse-withdrawal.less'],
'<%= dirs.css %>/dokan-product-category-ui.css': ['<%= dirs.devLessSrc %>/dokan-product-category-ui.less'],
'<%= dirs.css %>/dokan-admin-product.css': ['<%= dirs.devLessSrc %>/dokan-admin-product.less'],
}
}
},
Expand Down Expand Up @@ -71,7 +72,8 @@ module.exports = function(grunt) {
'!<%= dirs.devJsSrc %>/setup-no-wc.js',
'!<%= dirs.devJsSrc %>/helper.js',
'!<%= dirs.devJsSrc %>/reverse-withdrawal.js',
'!<%= dirs.devJsSrc %>/product-category-ui.js'
'!<%= dirs.devJsSrc %>/product-category-ui.js',
'!<%= dirs.devJsSrc %>/dokan-admin-product.js',
],
'<%= dirs.js %>/login-form-popup.js': [
'<%= dirs.devJsSrc %>/login-form-popup.js'
Expand Down
14 changes: 11 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, yith, yithemes
**Requires at least:** 5.4
**Tested up to:** 6.0.2
**Tested up to:** 6.0.3
**WC requires at least:** 5.0.0
**WC tested up to:** 6.9.4
**WC tested up to:** 7.0.0
**Requires PHP:** 7.0
**Stable tag:** 3.7.1
**Stable tag:** 3.7.2
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##

### v3.7.2 ( Oct 27, 2022 ) ###

**new:** Added a new filter hooked named `dokan_rest_api_store_collection_params` for StoreController request parameters
**new:** Introduced `dokanVendorFilterSectionStart` and `DokanGetVendorArgs` js filter hooks
**fix:** [AdminCommission] - Percentage Commission does not support "comma" as decimal separator under Dokan admin settings `Selling Options` page
**fix:** [Products] Product author is assigned to the shop manager when the shop manager publishes a product drafted by the admin.
**fix:** Spaces between paragraphs are too large under the store terms and condition page.

### v3.7.1 ( Oct 11, 2022 ) ###

- **fix:** [VariableProduct] Fixed variable product's variation image uploading height size overlapping on price field.
Expand Down
14 changes: 14 additions & 0 deletions assets/css/dokan-admin-product.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.dokan_product_author_override__avatar {
display: inline-block;
float: left;
}
.dokan_product_author_override__avatar img {
width: 22px;
height: auto;
border-radius: 50%;
border: 1px solid #eaeaea;
}
.dokan_product_author_override__title {
line-height: 1.7;
padding-left: 28px;
}
1 change: 1 addition & 0 deletions assets/css/dokan-admin-product.css.map

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

78 changes: 78 additions & 0 deletions assets/js/dokan-admin-product.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
dokanWebpack([7],{

/***/ 292:
/***/ (function(module, exports) {

(function ($) {
var DokanAdminProduct = {
searchVendors: function searchVendors(element) {
$(element).each(function () {
var selector = $(this);
var attributes = $(selector).data();
$(selector).selectWoo({
closeOnSelect: attributes['close_on_select'] ? true : false,
minimumInputLength: attributes['minimum_input_length'] ? attributes['minimum_input_length'] : '0',
ajax: {
url: dokan_admin_product.ajaxurl,
dataType: 'json',
delay: 250,
data: function data(params) {
return {
action: attributes['action'],
_wpnonce: dokan_admin_product.nonce,
s: params.term
};
},
processResults: function processResults(data, params) {
params.page = params.page || 1;
return {
results: data.data.vendors,
pagination: {
more: false // (params.page * 30) < data.total_count

}
};
},
cache: false
},
language: {
errorLoading: function errorLoading() {
return dokan_admin_product.i18n.error_loading;
},
searching: function searching() {
return dokan_admin_product.i18n.searching + '...';
},
inputTooShort: function inputTooShort() {
return dokan_admin_product.i18n.input_too_short + '...';
}
},
escapeMarkup: function escapeMarkup(markup) {
return markup;
},
templateResult: function templateResult(vendor) {
if (vendor.loading) {
return vendor.text;
}

var markup = "<div class='dokan_product_author_override-results clearfix'>" + "<div class='dokan_product_author_override__avatar'><img src='" + vendor.avatar + "' /></div>" + "<div class='dokan_product_author_override__title'>" + vendor.text + "</div></div>";
return markup;
},
templateSelection: function templateSelection(vendor) {
return vendor.text;
}
});
});
},
init: function init() {
dokan_admin.vendor_selectwoo('.dokan_product_author_override');
}
};
$(document).ready(function () {
window.dokan_admin.vendor_selectwoo = DokanAdminProduct.searchVendors;
DokanAdminProduct.init();
});
})(jQuery);

/***/ })

},[292]);
1 change: 1 addition & 0 deletions assets/js/dokan-admin-product.min.js

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

20 changes: 17 additions & 3 deletions assets/js/dokan.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,19 @@ jQuery(function($) {
$( 'td.line_tax', $row ).each( function() {
var line_total_tax = $( 'input.line_tax', $( this ) );
var refund_line_total_tax = $( 'input.refund_line_tax', $( this ) );
var unit_total_tax = accounting.unformat( line_total_tax.attr( 'data-total_tax' ), dokan_refund.mon_decimal_point ) / qty;
var unit_total_tax = accounting.unformat(
line_total_tax.attr( 'data-total_tax' ),
dokan_refund.mon_decimal_point
) / qty;

if ( 0 < unit_total_tax ) {
var round_at_subtotal = 'yes' === dokan_refund.round_at_subtotal;
var precision = dokan_refund[
round_at_subtotal ? 'rounding_precision' : 'currency_format_num_decimals'
];

refund_line_total_tax.val(
parseFloat( accounting.formatNumber( unit_total_tax * refund_qty, dokan_refund.rounding_precision, '' ) )
parseFloat( accounting.formatNumber( unit_total_tax * refund_qty, precision, '' ) )
.toString()
.replace( '.', dokan_refund.mon_decimal_point )
).trigger( 'change' );
Expand Down Expand Up @@ -1132,7 +1140,6 @@ jQuery(function($) {
$($html).find('.dokan-product-attribute-heading').css({ borderBottom: '1px solid #e3e3e3' });

attributeWrapper.append( $html );
$( 'select#product_type' ).trigger('change');
Dokan_Editor.loadSelect2();
Dokan_Editor.bindProductTagDropdown();
Dokan_Editor.attribute.reArrangeAttribute();
Expand All @@ -1156,6 +1163,9 @@ jQuery(function($) {
attrWrap.find( 'option[value="' + attribute + '"]' ).attr( 'disabled','disabled' );
attrWrap.val( '' );
}
})
.done(function() {
$( 'select#product_type' ).trigger('change');
});
},

Expand Down Expand Up @@ -1270,6 +1280,10 @@ jQuery(function($) {
} else {
$('.show_if_stock').slideUp('fast');
}

if ( 'simple' === product_type ) {
$(this).is(':checked') ? $('.hide_if_stock_global').slideUp('fast') : $('.hide_if_stock_global').slideDown('fast');
}
},

gallery: {
Expand Down
59 changes: 49 additions & 10 deletions assets/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function dokan_get_i18n_date_format( format = true ) {
*
* @return {string} Return a specific time format
*/
function dokan_get_i18n_time_format( format = true ) {
function dokan_get_i18n_time_format( format = true ) {
if ( ! format ) {
return dokan_helper.i18n_time_format;
}
Expand Down Expand Up @@ -86,6 +86,13 @@ function dokan_get_i18n_date_format( format = true ) {
timeFormat = '';

for ( i = 0; i < dokan_helper.i18n_time_format.length; i++ ) {
if ( '\\' === dokan_helper.i18n_time_format[ i ] ) {
timeFormat += dokan_helper.i18n_time_format[ i ];
i++;
timeFormat += dokan_helper.i18n_time_format[ i ];
continue;
}

char = dokan_helper.i18n_time_format[ i ];

if ( char in replacements ) {
Expand All @@ -108,14 +115,23 @@ function dokan_get_i18n_date_format( format = true ) {
*
* @return {string} Return formatted time.
*/
function dokan_get_formatted_time( time, format ) {
const times = new Date( Date.parse( `Jan 1 ${time}` ) ), // We used this dummy date for getting time info.
function dokan_get_formatted_time( time_string, output_format, input_format = dokan_get_i18n_time_format() ) {
const length = output_format.length;
// return if no length is provided
if ( length <= 0 ) {
return '';
}

const times = moment( time_string, input_format ).toDate(), // We used this date for getting time info.
add0 = function( t ) { return t < 10 ? '0' + t : t; },
hours = times.getHours(),
minutes = times.getMinutes(),
seconds = times.getSeconds(),
hours = String( times.getHours() ),
minutes = String( times.getMinutes() ),
seconds = String( times.getSeconds() ),
sampm = hours >= 12 ? 'pm' : 'am',
campm = hours >= 12 ? 'PM' : 'AM',
checkFormat = ( formats, format ) => {
return formats[format] ? formats[format] : format;
}
convertTime = ( time ) => {
// Check correct time format and split into components
time = time.toString().match(/^([01]\d|2[0-3])(:)([0-5]\d)(:[0-5]\d)?$/) || [time];
Expand All @@ -127,7 +143,7 @@ function dokan_get_formatted_time( time, format ) {

return time[0];
},
hour12 = convertTime (`${add0( hours )}:${add0( minutes )}`),
hour12 = convertTime (`${add0( hours )}:${add0( minutes )}`),
replaceMent = {
'hh' : add0( hour12 ),
'h' : hour12,
Expand All @@ -145,11 +161,34 @@ function dokan_get_formatted_time( time, format ) {
'a' : sampm,
};

for ( let key in replaceMent ) {
format = format.replace( key, replaceMent[ key ] );
let formatted_string = '',
temp_string = '',
current_string = '';

for ( let i = 0; i < length; i++ ) {
// get current string
current_string = output_format[i];

if ( '\\' === current_string ) {
if ( temp_string.length > 0 ) {
formatted_string += checkFormat( replaceMent, temp_string );
temp_string = '';
}
i++;
formatted_string += output_format[i];
} else if ( temp_string.length === 0 ) {
temp_string = current_string;
} else if ( temp_string !== current_string ) {
formatted_string += checkFormat( replaceMent, temp_string );
temp_string = current_string;
} else if ( temp_string === current_string ) {
temp_string += current_string;
}
}

return format;
formatted_string += temp_string.length ? checkFormat( replaceMent, temp_string ) : '';

return formatted_string;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion assets/js/vendor-registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ var Dokan_Vendor_Registration = {

// boot the class onReady
$(function() {
Dokan_Vendor_Registration.init();
window.Dokan_Vendor_Registration = Dokan_Vendor_Registration;
window.Dokan_Vendor_Registration.init();

$('.show_if_seller').find( 'input, select' ).attr( 'disabled', 'disabled' );

Expand Down
33 changes: 32 additions & 1 deletion assets/js/vue-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7388,6 +7388,13 @@ var RefreshSettingOptions = dokan_get_lib('RefreshSettingOptions');
//
//
//
//
//
//
//
//
//
//


var ListTable = dokan_get_lib('ListTable');
Expand Down Expand Up @@ -7458,7 +7465,8 @@ var AdminNotice = dokan_get_lib('AdminNotice');
vendors: [],
loadAddVendor: false,
dokanVendorHeaderArea: dokan.hooks.applyFilters('getDokanVendorHeaderArea', []),
isVendorSwitchingEnabled: false
isVendorSwitchingEnabled: false,
dokanVendorFilterSectionStart: dokan.hooks.applyFilters('dokanVendorFilterSectionStart', [])
};
},
watch: {
Expand Down Expand Up @@ -7525,6 +7533,13 @@ var AdminNotice = dokan_get_lib('AdminNotice');
addNew: function addNew() {
this.loadAddVendor = true;
},
updateVendorComponent: function updateVendorComponent() {
var rerender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

if (rerender) {
this.fetchVendors();
}
},
doSearch: function doSearch(payload) {
var _this2 = this;

Expand Down Expand Up @@ -7564,6 +7579,7 @@ var AdminNotice = dokan_get_lib('AdminNotice');
order: self.sortOrder,
store_category: self.storeCategory
};
data = dokan.hooks.applyFilters('DokanGetVendorArgs', data, this.$route.query);
dokan.api.get('/stores', data).done(function (response, status, xhr) {
self.vendors = response;
self.loading = false;
Expand Down Expand Up @@ -17031,6 +17047,21 @@ var render = function() {
)
})
}
},
{
key: "filters",
fn: function(data) {
return _vm._l(_vm.dokanVendorFilterSectionStart, function(
dokanVendorFilterSection,
index
) {
return _c(dokanVendorFilterSection, {
key: index,
tag: "component",
on: { updateVendorComponent: _vm.updateVendorComponent }
})
})
}
}
])
}),
Expand Down
2 changes: 1 addition & 1 deletion assets/js/vue-admin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/vue-vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/******/
/******/ // objects to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 7: 0
/******/ 8: 0
/******/ };
/******/
/******/ // The require function
Expand Down
Loading

0 comments on commit ace5c09

Please sign in to comment.