Skip to content

Commit

Permalink
Merge branch 'release/3.12.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
shohag121 committed Oct 3, 2024
2 parents d31c305 + 625cde7 commit 8b6659b
Show file tree
Hide file tree
Showing 18 changed files with 460 additions and 90 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
**WC requires at least:** 8.0.0
**WC tested up to:** 9.3.3
**Requires PHP:** 7.4
**Stable tag:** 3.12.3
**Stable tag:** 3.12.4
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##

### v3.12.4 ( Oct 03, 2024 ) ###

- **update:** Added `$data` parameter to `dokan_update_vendor` hook.

### v3.12.3 ( Sep 30, 2024 ) ###

- **update:** Added compatibility with RFQ state field ui.
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
* Plugin URI: https://dokan.co/wordpress/
* Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
* Version: 3.12.3
* Version: 3.12.4
* Author: weDevs
* Author URI: https://dokan.co/
* Text Domain: dokan-lite
Expand Down Expand Up @@ -66,7 +66,7 @@ final class WeDevs_Dokan {
*
* @var string
*/
public $version = '3.12.2';
public $version = '3.12.4';

/**
* Instance of self
Expand Down
19 changes: 18 additions & 1 deletion includes/Vendor/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,28 @@ public function update( $vendor_id, $data = [] ) {
}
}

/**
* Fires before a vendor is updated.
*
* @since 2.9.10
*
* @param int $vendor_id The ID of the vendor being updated.
* @param array $data The array of vendor data being updated.
*/
do_action( 'dokan_before_update_vendor', $vendor->get_id(), $data );

$vendor->save();

do_action( 'dokan_update_vendor', $vendor->get_id() );
/**
* Fires after a vendor has been updated.
*
* @since 2.9.10
* @since 3.12.4 added $data parameter
*
* @param int $vendor_id The ID of the vendor that was updated.
* @param array $data The array of vendor data that was updated.
*/
do_action( 'dokan_update_vendor', $vendor->get_id(), $data );

return $vendor->get_id();
}
Expand Down
4 changes: 2 additions & 2 deletions languages/dokan-lite.pot
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright (c) 2024 weDevs Pte. Ltd. All Rights Reserved.
msgid ""
msgstr ""
"Project-Id-Version: Dokan 3.12.3\n"
"Project-Id-Version: Dokan 3.12.4\n"
"Report-Msgid-Bugs-To: https://dokan.co/contact/\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-09-30T09:33:46+00:00\n"
"POT-Creation-Date: 2024-10-03T05:38:32+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: dokan-lite\n"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dokan",
"version": "3.12.3",
"version": "3.12.4",
"description": "A WordPress marketplace plugin",
"author": "weDevs",
"license": "GPL",
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tested up to: 6.6.2
WC requires at least: 8.0.0
WC tested up to: 9.3.3
Requires PHP: 7.4
Stable tag: 3.12.3
Stable tag: 3.12.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

== Changelog ==

= v3.12.4 ( Oct 03, 2024 ) =

- **update:** Added `$data` parameter to `dokan_update_vendor` hook.

= v3.12.3 ( Sep 30, 2024 ) =

- **update:** Added compatibility with RFQ state field ui.
Expand Down
12 changes: 12 additions & 0 deletions templates/whats-new.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
* When you are adding new version please follow this sequence for changes: New Feature, New, Improvement, Fix...
*/
$changelog = [
[
'version' => 'Version 3.12.4',
'released' => '2024-10-03',
'changes' => [
'Improvement' => [
[
'title' => 'Added `$data` parameter to `dokan_update_vendor` hook.',
'description' => '',
],
],
],
],
[
'version' => 'Version 3.12.3',
'released' => '2024-09-30',
Expand Down
34 changes: 28 additions & 6 deletions tests/pw/feature-map/feature-map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,25 @@
vendor can't add product discount price higher than price [lite]: true
vendor can remove product discount price [lite]: true
vendor can remove product discount schedule [lite]: true

vendor can update product category (single) [lite]: true
vendor can add product category (multiple): true
vendor can remove product category (multiple): true
vendor can add multi-step product category (last category) [lite]: true
vendor can add multi-step product category (any category) [lite]: true
vendor can't add multi-step product category (any category) [lite]: true
vendor can add product tags [lite]: true
vendor can remove product tags [lite]: true
vendor can create product tags: true
vendor can add product cover image [lite]: true
vendor can update product cover image [lite]: true
vendor can remove product cover image [lite]: true
vendor can add product gallery image [lite]: true
vendor can update product gallery image [lite]: true
vendor can remove product gallery image [lite]: true
vendor can add product short description [lite]: true
vendor can update product short description [lite]: true
vendor can remove product short description [lite]: true
vendor can update product description [lite]: true

- page: 'MyOrders'
features:
Expand Down Expand Up @@ -166,13 +184,17 @@
vendor:
vendor can view payment settings menu page [lite]: true
vendor can add paypal payment method [lite]: true
vendor can update paypal payment method [lite]: true
vendor can remove paypal payment method [lite]: true
vendor can add bank payment method [lite]: true
vendor can add Skrill payment method: true
vendor can update bank payment method [lite]: true
vendor can remove bank payment method [lite]: true
vendor can add skrill payment method: true
vendor can update skrill payment method: true
vendor can remove skrill payment method: true
vendor can add custom payment method: true
vendor can disconnect paypal payment method: true
vendor can disconnect bank payment method: true
vendor can disconnect Skrill payment method: true
vendor can disconnect custom payment method: true
vendor can update custom payment method: true
vendor can remove custom payment method: true

- page: 'Shop'
features:
Expand Down
82 changes: 31 additions & 51 deletions tests/pw/pages/paymentsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export class PaymentsPage extends AdminPage {

// payment methods

async goToPaymentSettings() {
async goToWcPaymentSettings() {
await this.goIfNotThere(data.subUrls.backend.wc.paymentSettings);
}

// admin setup basic payment methods
async setupBasicPaymentMethods(payment: payment) {
await this.goToPaymentSettings();
await this.goToWcPaymentSettings();

// bank transfer
await this.enablePaymentMethod(paymentSettingsAdmin.enableDirectBankTransfer);
Expand All @@ -38,7 +38,7 @@ export class PaymentsPage extends AdminPage {

// admin setup stripe sonnect
async setupStripeConnect(payment: payment) {
await this.goToPaymentSettings();
await this.goToWcPaymentSettings();

await this.click(paymentSettingsAdmin.setupDokanStripeConnect);
// setup strip connect
Expand All @@ -63,7 +63,7 @@ export class PaymentsPage extends AdminPage {

// admin setup dokan paypal marketplace
async setupPaypalMarketPlace(payment: payment) {
await this.goToPaymentSettings();
await this.goToWcPaymentSettings();

await this.click(paymentSettingsAdmin.setupDokanPayPalMarketplace);
// setup paypal marketplace
Expand Down Expand Up @@ -91,7 +91,7 @@ export class PaymentsPage extends AdminPage {

// admin setup mangopay
async setupMangoPay(payment: payment) {
await this.goToPaymentSettings();
await this.goToWcPaymentSettings();

await this.click(paymentSettingsAdmin.setupDokanMangoPay);
// setup mangopay
Expand Down Expand Up @@ -138,7 +138,7 @@ export class PaymentsPage extends AdminPage {

// admin setup razorpay
async setupRazorpay(payment: payment) {
await this.goToPaymentSettings();
await this.goToWcPaymentSettings();

await this.click(paymentSettingsAdmin.setupDokanRazorpay);
// setup razorpay
Expand All @@ -162,7 +162,7 @@ export class PaymentsPage extends AdminPage {

// admin setup stripe express
async setupStripeExpress(payment: payment) {
await this.goToPaymentSettings();
await this.goToWcPaymentSettings();

await this.click(paymentSettingsAdmin.setupDokanStripeExpress);

Expand Down Expand Up @@ -217,46 +217,53 @@ export class PaymentsPage extends AdminPage {
// paymentMethods dropdown is visible
await this.toBeVisible(paymentSettingsVendor.paymentMethods.addPaymentMethodDropDown);

await this.notToHaveCount(paymentSettingsVendor.paymentMethods.noOfPaymentMethods, 0);
// await this.notToHaveCount(paymentSettingsVendor.paymentMethods.noOfPaymentMethods, 0);
}

// vendor set basic payment settings
async setBasicPaymentSettings(payment: vendor['payment']): Promise<void> {
await this.setBasicPayment({ ...data.vendor.payment, methodName: 'paypal' });
await this.setBankTransfer(payment);
await this.setBasicPayment({ ...data.vendor.payment, methodName: 'skrill' });
await this.setBasicPayment({ ...data.vendor.payment, methodName: 'custom' });
}

// set basic payment method [paypal, skrill, custom ]
async setBasicPayment(paymentMethod: vendor['payment']): Promise<void> {
switch (paymentMethod.methodName) {
// goto payment settings
async goToPaymentSettings(methodName: string): Promise<void> {
switch (methodName) {
case 'paypal':
await this.goIfNotThere(data.subUrls.frontend.vDashboard.paypal);
await this.goto(data.subUrls.frontend.vDashboard.paypal);
break;

case 'bank':
await this.goto(data.subUrls.frontend.vDashboard.bankTransfer);
break;

case 'skrill':
await this.goIfNotThere(data.subUrls.frontend.vDashboard.skrill);
await this.goto(data.subUrls.frontend.vDashboard.skrill);
break;

case 'custom':
await this.goIfNotThere(data.subUrls.frontend.vDashboard.customPayment);
await this.goto(data.subUrls.frontend.vDashboard.customPayment);
break;

default:
break;
}
}

// set basic payment method [paypal, skrill, custom ]
async addBasicPayment(paymentMethod: vendor['payment']): Promise<void> {
await this.goToPaymentSettings(paymentMethod.methodName);
await this.clearAndType(paymentSettingsVendor.paymentEmail, paymentMethod.email());
await this.clickAndWaitForResponse(data.subUrls.ajax, paymentSettingsVendor.updateSettings);
await this.toContainText(paymentSettingsVendor.updateSettingsSuccessMessage, paymentMethod.saveSuccessMessage);
}

// disconnect basic payment method [paypal, skrill, custom ]
async removeBasicPayment(paymentMethod: vendor['payment']): Promise<void> {
await this.goToPaymentSettings(paymentMethod.methodName);
await this.clickAndWaitForResponse(data.subUrls.ajax, paymentSettingsVendor.disconnectPayment);
await this.toContainText(paymentSettingsVendor.updateSettingsSuccessMessage, paymentMethod.saveSuccessMessage);
}

// bank transfer payment settings
async setBankTransfer(paymentMethod: vendor['payment']): Promise<void> {
async addBankTransfer(paymentMethod: vendor['payment']): Promise<void> {
await this.goIfNotThere(data.subUrls.frontend.vDashboard.bankTransfer);

await this.clickIfVisible(paymentSettingsVendor.disconnectAccount);
// await this.clickIfVisible(paymentSettingsVendor.disconnectAccount);
await this.clearAndType(paymentSettingsVendor.bankAccountName, paymentMethod.bankAccountName);
await this.selectByValue(paymentSettingsVendor.bankAccountType, paymentMethod.bankAccountType);
await this.clearAndType(paymentSettingsVendor.bankAccountNumber, paymentMethod.bankAccountNumber);
Expand All @@ -270,31 +277,4 @@ export class PaymentsPage extends AdminPage {
await this.clickAndWaitForResponse(data.subUrls.ajax, paymentSettingsVendor.addAccount);
await this.toContainText(paymentSettingsVendor.updateSettingsSuccessMessage, paymentMethod.saveSuccessMessage);
}

// disconnect basic payment method [paypal, skrill, custom ]
async disconnectBasicPayment(paymentMethod: vendor['payment']): Promise<void> {
switch (paymentMethod.methodName) {
case 'paypal':
await this.goIfNotThere(data.subUrls.frontend.vDashboard.paypal);
break;

case 'bank':
await this.goIfNotThere(data.subUrls.frontend.vDashboard.bankTransfer);
break;

case 'skrill':
await this.goIfNotThere(data.subUrls.frontend.vDashboard.skrill);
break;

case 'custom':
await this.goIfNotThere(data.subUrls.frontend.vDashboard.customPayment);
break;

default:
break;
}

await this.clickAndWaitForResponse(data.subUrls.ajax, paymentSettingsVendor.disconnectPayment);
await this.toContainText(paymentSettingsVendor.updateSettingsSuccessMessage, paymentMethod.saveSuccessMessage);
}
}
Loading

0 comments on commit 8b6659b

Please sign in to comment.