Skip to content

Commit 6714e1d

Browse files
chore: Release version 4.2.1
Merge branch 'release/4.2.1'
2 parents cdb964d + faec578 commit 6714e1d

File tree

51 files changed

+2313
-5583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2313
-5583
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
### v4.2.1 ( Dec 04, 2025 ) ###
2+
- **new:** Added a "Filter by Vendor Sub-orders" option to the WooCommerce Orders page to easily filter specific marketplace orders.
3+
- **update:** Redesigned the Admin Panel "Not Found" page template for a better look and user experience.
4+
- **update:** Ensured full compatibility for the legacy admin panel store support page.
5+
- **update:** Improved how tooltips appear and remain visible in both the Dokan vendor and admin panels.
6+
- **update:** Clicking the site title in the new vendor dashboard now redirects to the marketplace main site URL.
7+
- **update:** Added support for legacy URL settings to the "Visit Dashboard" button within the Admin Setup Wizard.
8+
- **fix:** Applied menu manager support to correctly control the vendor sidebar menus in the new dashboard layout.
9+
- **fix:** Added the ability to sort the vendor management table by registration date.
10+
- **fix:** Corrected the default toggle switch states when creating a new vendor to ensure they start in the intended position.
11+
- **fix:** Added checks to ensure users without a vendor account are redirected to a proper "404 Not Found" page instead of an error.
12+
- **fix:** Allowed vendors to correctly enter decimal amounts in the withdrawal request popup.
13+
- **fix:** Ensured that admin-configured banner dimensions are correctly displayed in the admin vendor settings.
14+
- **fix:** Fixed an issue where manual withdrawal requests now correctly reflect the settings configured by the admin.
15+
- **fix:** Updated the correct method for translating text (text domain handling) for recommended plugins.
16+
- **fix:** Prevented the "Complete Your Marketplace Setup" widget from showing up after the vendor has finished all the onboarding steps.
17+
- **fix:** Added support for including product variations in products rest api requests.
18+
- **fix:** Stopped unnecessary warnings and notices from appearing during the initial store setup process.
19+
- **fix:** Restored the side-by-side layout for the main Admin Dashboard panel.
20+
- **fix:** Prevent console warning from admin panel setup guide banner elements.
21+
- **fix:** Remove setup guide banner for admin setup guide pages.
22+
123
### v4.2.0 ( Nov 24, 2025 ) ###
224
- **update:** Ensured full compatibility for the legacy admin panel across Subscriptions, Announcements, Wholesale, Product Ads, Abuse Reports, Seller Badge, and Refund pages.
325
- **update:** The vendor dashboard now supports modern, full-width theme layouts, providing a more spacious user experience.

assets/src/js/script.js

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -167,39 +167,15 @@ jQuery(function($) {
167167
dokan.store_banner_dimension['flex-height'],
168168
10
169169
),
170-
ratio,
171-
xImg,
172-
yImg,
173170
realHeight,
174171
realWidth,
175172
imgSelectOptions;
176173

177174
realWidth = attachment.get('width');
178175
realHeight = attachment.get('height');
179176

180-
this.headerImage = new api.HeaderTool.ImageModel();
181-
this.headerImage.set({
182-
themeWidth: xInit,
183-
themeHeight: yInit,
184-
themeFlexWidth: flexWidth,
185-
themeFlexHeight: flexHeight,
186-
imageWidth: realWidth,
187-
imageHeight: realHeight
188-
});
189-
190-
controller.set('canSkipCrop', !this.headerImage.shouldBeCropped());
191-
192-
ratio = xInit / yInit;
193-
xImg = realWidth;
194-
yImg = realHeight;
195-
196-
if (xImg / yImg > ratio) {
197-
yInit = yImg;
198-
xInit = yInit * ratio;
199-
} else {
200-
xInit = xImg;
201-
yInit = xInit / ratio;
202-
}
177+
var control = controller.get('control');
178+
controller.set('canSkipCrop', !control.mustBeCropped(flexWidth, flexHeight, xInit, yInit, realWidth, realHeight));
203179

204180
imgSelectOptions = {
205181
handles: true,
@@ -211,19 +187,12 @@ jQuery(function($) {
211187
x1: 0,
212188
y1: 0,
213189
x2: xInit,
214-
y2: yInit
190+
y2: yInit,
191+
aspectRatio: xInit + ':' + yInit,
192+
maxHeight: yInit,
193+
maxWidth: xInit,
215194
};
216195

217-
if (flexHeight === false && flexWidth === false) {
218-
imgSelectOptions.aspectRatio = xInit + ':' + yInit;
219-
}
220-
if (flexHeight === false) {
221-
imgSelectOptions.maxHeight = yInit;
222-
}
223-
if (flexWidth === false) {
224-
imgSelectOptions.maxWidth = xInit;
225-
}
226-
227196
return imgSelectOptions;
228197
},
229198

@@ -310,6 +279,45 @@ jQuery(function($) {
310279

311280
settings.uploadBtn = this;
312281

282+
var cropControl = {
283+
id: "control-id",
284+
params: {
285+
width: parseInt(dokan.store_banner_dimension.width, 10),
286+
height: parseInt(dokan.store_banner_dimension.height, 10),
287+
flex_width: !!parseInt(dokan.store_banner_dimension['flex-width'], 10),
288+
flex_height: !!parseInt(dokan.store_banner_dimension['flex-height'], 10),
289+
}
290+
};
291+
292+
cropControl.mustBeCropped = function(flexW, flexH, dstW, dstH, imgW, imgH) {
293+
// If the width and height are both flexible then the user does not need to crop the image
294+
if (true === flexW && true === flexH) {
295+
return false;
296+
}
297+
298+
// If the width is flexible and the cropped image height matches the current image height, then the user does not need to crop the image.
299+
if (true === flexW && dstH === imgH) {
300+
return false;
301+
}
302+
303+
// If the height is flexible and the cropped image width matches the current image width, then the user does not need to crop the image.
304+
if (true === flexH && dstW === imgW) {
305+
return false;
306+
}
307+
308+
// If the cropped image width matches the current image width, and the cropped image height matches the current image height, then the user does not need to crop the image.
309+
if (dstW === imgW && dstH === imgH) {
310+
return false;
311+
}
312+
313+
// If the destination width is equal to or greater than the cropped image width then the user does not need to crop the image
314+
if (imgW <= dstW) {
315+
return false;
316+
}
317+
318+
return true;
319+
};
320+
313321
settings.frame = wp.media({
314322
multiple: false,
315323
button: {
@@ -326,9 +334,9 @@ jQuery(function($) {
326334
suggestedWidth: dokan.store_banner_dimension.width,
327335
suggestedHeight: dokan.store_banner_dimension.height
328336
}),
329-
new wp.media.controller.Cropper({
330-
suggestedWidth: 5000,
331-
imgSelectOptions: settings.calculateImageSelectOptions
337+
new wp.media.controller.CustomizeImageCropper({
338+
imgSelectOptions: settings.calculateImageSelectOptions,
339+
control: cropControl
332340
})
333341
]
334342
});

composer.lock

Lines changed: 29 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)