Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f52bc2d
set ids
akzmoudud Oct 1, 2025
766aed9
test case
akzmoudud Oct 3, 2025
f78769a
Merge remote-tracking branch 'origin/enhance/map-all-the-settings-sto…
akzmoudud Oct 3, 2025
96e8bb2
e2e testing for newGeneralMarketplace
akzmoudud Oct 5, 2025
e1a4079
e2e testing for vendor onboarding section
akzmoudud Oct 6, 2025
d2c06f1
Construct mapping new social onboarding page with old setting page an…
akzmoudud Oct 6, 2025
6c4e006
fix bugs and enhancement of vendor - vendor capabilities page
akzmoudud Oct 7, 2025
e8a6a8b
e2e test for vendor capabilities page
akzmoudud Oct 7, 2025
f54eb4e
admin settings: Data driven test
mrabbani Oct 16, 2025
7ccf369
Re-organized the test cases and fix the menu DOM id duplication
mrabbani Oct 17, 2025
4ddbf12
Merge branch 'feat/admin-settings' into enhance/new-admin-settings-fi…
mrabbani Oct 20, 2025
d04d741
update: general settings
mrabbani Oct 20, 2025
0434039
Add aria label for radio
mrabbani Oct 21, 2025
7c1a440
Add e2e tests for new General
mrabbani Oct 21, 2025
10e56fa
fix: e2e admin page inheritance
mrabbani Oct 21, 2025
4663f8f
e2e: Update test steps
mrabbani Oct 21, 2025
aa7c2c0
feat: Add checkbox field type support for toggle switches in admin se…
mrabbani Oct 29, 2025
640a57e
Updated radio type for handling old and new radio buttons
akzmoudud Oct 29, 2025
72da54e
debug: Add console logging for checkbox state verification in admin s…
mrabbani Oct 29, 2025
4d595bb
fix: resolve E2E test timeout errors in General settings migration test
mrabbani Oct 29, 2025
2e6cb19
feat: add reloadUrl method and optimize E2E test performance
mrabbani Oct 29, 2025
20ab4be
Rename the steps
mrabbani Oct 29, 2025
cb28d17
Merge branch 'enhance/map-all-the-settings-storage-key-based-on-setti…
akzmoudud Oct 30, 2025
9278a92
e2e test for generalMarketplace page
akzmoudud Oct 30, 2025
b022708
Vendor Onboarding Page
akzmoudud Oct 31, 2025
a4efea0
pages of vendor section
akzmoudud Oct 31, 2025
deddfa5
Set ID of showHide fields
akzmoudud Oct 31, 2025
564f2f0
Social Onboarding Page
akzmoudud Nov 3, 2025
31d44be
Vendor Capabilities Page
akzmoudud Nov 3, 2025
8526444
Vendor Subscription Page
akzmoudud Nov 3, 2025
8ab4fcb
Single Product Milti-vendor Page
akzmoudud Nov 4, 2025
95c6fa5
Moderation RMA Page
akzmoudud Nov 5, 2025
131cf4c
Updated VendorSubscription Page
akzmoudud Nov 5, 2025
d6b73d1
Moderation pages templets
akzmoudud Nov 5, 2025
f320034
Moderation Store Support Page
akzmoudud Nov 6, 2025
a52145a
Moderation Live Chat Page
akzmoudud Nov 11, 2025
ff259eb
Moderation Abuse Report Page
akzmoudud Nov 11, 2025
1148fb5
Implement mapping of delivery time page between new and old page
akzmoudud Nov 11, 2025
40fb097
Implement mapping of new shipment settings page with old setting page
akzmoudud Nov 11, 2025
688093f
Shipment settings Page
akzmoudud Nov 12, 2025
8fc893d
Shipment Delivery Time Page
akzmoudud Nov 12, 2025
04d7263
Updated Shipment Settings Page
akzmoudud Nov 12, 2025
43a6f89
Implement proper option filed of Privacy Policy Page (Compliance -> P…
akzmoudud Nov 13, 2025
2970b85
Complaince Privacy Page
akzmoudud Nov 13, 2025
f68a904
Compliance EU Complaince Page
akzmoudud Nov 13, 2025
632c266
Fix keys of Shipping Fee, Product Tax Fee and Shipping Tax Fee from v…
akzmoudud Nov 13, 2025
8a8b981
Transaction Fees Page
akzmoudud Nov 13, 2025
d39da04
Fixed Commission Page Mapping
akzmoudud Nov 14, 2025
eb42c5a
Transaction Commission Page
akzmoudud Nov 14, 2025
1945abe
Transaction reverse Withdrawal
akzmoudud Nov 14, 2025
2c91b71
Implement mapping of Minimum Withdraw Limit and Withdraw Threshold of…
akzmoudud Nov 17, 2025
b7599ad
Transaction Withdraw Page
akzmoudud Nov 17, 2025
ab353a7
updated e2e test for Available Vendor Section Display Position field …
akzmoudud Nov 18, 2025
5e9c717
Fix component for tooltip
akzmoudud Nov 20, 2025
509f531
fix mb
akzmoudud Nov 21, 2025
470dfe6
updated
akzmoudud Nov 21, 2025
ee3a5ee
Merge branch 'enhance/map-all-the-settings-storage-key-based-on-setti…
akzmoudud Nov 21, 2025
3c26962
Testing (fix mapping)
akzmoudud Nov 24, 2025
dcdf47d
Merge branch 'enhance/map-all-the-settings-storage-key-based-on-setti…
akzmoudud Nov 24, 2025
d730ba6
Make code workable for callback functions and map customer details vi…
akzmoudud Nov 25, 2025
d4532e7
callback Mapper Admin Settings in progress
Shamim-97 Nov 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions includes/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function get_settings_value() {
$settings = [];

// Ensure new settings are populated from legacy if currently blank
$this->ensure_new_settings_populated_from_legacy();
// $this->ensure_new_settings_populated_from_legacy();

// Build legacy-style values from the new settings storage.
$legacy_from_new = $this->get_legacy_values_from_new();
Expand Down Expand Up @@ -195,12 +195,17 @@ public function save_settings_value() {

// Transform legacy section values to new settings storage and save
$transformer = new LegacyTransformer();
$new_data = $transformer->transform( [ 'from' => 'old', 'data' => [ $option_name => $option_value ] ] );
$new_data = $transformer->transform(
[
'from' => 'old',
'data' => [ $option_name => $option_value ],
]
);

if ( ! empty( $new_data ) ) {
/** @var NewAdminSettingsManager $settings_manager */
$settings_manager = dokan_get_container()->get( NewAdminSettingsManager::class );
$settings_manager->save( $new_data );
$settings_manager->save( $new_data, false );

// Fallback: if pages are not registered/available, write directly to new storage options
$available_ids = [];
Expand Down Expand Up @@ -1325,9 +1330,9 @@ protected function ensure_new_settings_populated_from_legacy(): void {
if ( ! is_array( $existing ) ) {
$existing = [];
}
$wrapped = [ $page_id => $page_values ];
$wrapped = [ $page_id => $page_values ];
// Merge so we don't drop any pre-existing values.
$merged = array_replace_recursive( $existing, $wrapped );
$merged = array_replace_recursive( $existing, $wrapped );
update_option( $storage_key, $merged );
}
}
Expand Down
15 changes: 11 additions & 4 deletions includes/Admin/Settings/Pages/CompliancePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace WeDevs\Dokan\Admin\Settings\Pages;

use WeDevs\Dokan\Admin\Settings\Elements\ElementFactory;
use WeDevs\Dokan\Admin\Settings;

class CompliancePage extends AbstractPage {

Expand Down Expand Up @@ -78,6 +79,15 @@ public function settings(): array {
* @return void
*/
public function describe_settings(): void {
$legacy_settings = dokan_get_container()->get( Settings::class );
$pages_array = $legacy_settings->get_post_type( 'page' );
$options = [];
foreach ( $pages_array as $key => $label ) {
$options[] = [
'title' => $label,
'value' => $key,
];
}
// Create Privacy subpage
$privacy_page = ElementFactory::sub_page( 'privacy' )
->set_priority( 100 )
Expand Down Expand Up @@ -106,10 +116,7 @@ public function describe_settings(): void {
->set_title( esc_html__( 'Privacy Policy Page', 'dokan-lite' ) )
->set_description( esc_html__( 'Choose which page displays your privacy policy', 'dokan-lite' ) )
->set_placeholder( esc_html__( 'Select a page', 'dokan-lite' ) )
->add_option( esc_html__( 'Privacy Policy', 'dokan-lite' ), 'privacy-policy' )
->add_option( esc_html__( 'Terms of Service', 'dokan-lite' ), 'terms-of-service' )
->add_option( esc_html__( 'Legal Information', 'dokan-lite' ), 'legal-information' )
->set_default( 'privacy-policy' )
->set_options( $options )
);

// Create Privacy Policy Content section
Expand Down
12 changes: 6 additions & 6 deletions includes/Admin/Settings/Pages/TransactionPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,25 +192,25 @@ public function describe_settings(): void {
ElementFactory::field( 'shipping_fee', 'radio_capsule' )
->set_title( esc_html__( 'Shipping Fee', 'dokan-lite' ) )
->set_description( esc_html__( 'Who will be receiving the shipping fees? Note that, tax fees for corresponding shipping method will not be included with shipping fees.', 'dokan-lite' ) )
->add_option( esc_html__( 'Vendor', 'dokan-lite' ), 'vendor', 'Users' )
->add_option( esc_html__( 'Vendor', 'dokan-lite' ), 'seller', 'Users' )
->add_option( esc_html__( 'Admin', 'dokan-lite' ), 'admin', 'User' )
->set_default( 'vendor' )
->set_default( 'seller' )
)
->add(
ElementFactory::field( 'product_tax_fee', 'radio_capsule' )
->set_title( esc_html__( 'Product Tax Fee', 'dokan-lite' ) )
->set_description( esc_html__( 'Who will be receiving the tax fees for products? Note that, shipping tax fees will not be included with product tax.', 'dokan-lite' ) )
->add_option( esc_html__( 'Vendor', 'dokan-lite' ), 'vendor', 'Users' )
->add_option( esc_html__( 'Vendor', 'dokan-lite' ), 'seller', 'Users' )
->add_option( esc_html__( 'Admin', 'dokan-lite' ), 'admin', 'User' )
->set_default( 'vendor' )
->set_default( 'seller' )
)
->add(
ElementFactory::field( 'shipping_tax_fee', 'radio_capsule' )
->set_title( esc_html__( 'Shipping Tax Fee', 'dokan-lite' ) )
->set_description( esc_html__( 'Who will be receiving the tax fees for shipping?', 'dokan-lite' ) )
->add_option( esc_html__( 'Vendor', 'dokan-lite' ), 'vendor', 'Users' )
->add_option( esc_html__( 'Vendor', 'dokan-lite' ), 'seller', 'Users' )
->add_option( esc_html__( 'Admin', 'dokan-lite' ), 'admin', 'User' )
->set_default( 'vendor' )
->set_default( 'seller' )
);

// Add the fees section to fees page
Expand Down
2 changes: 2 additions & 0 deletions includes/Admin/Settings/Pages/VendorPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public function describe_settings(): void {
->set_enable_state( esc_html__( 'Enabled', 'dokan-lite' ), 'on' )
->set_disable_state( esc_html__( 'Disabled', 'dokan-lite' ), 'off' )
->set_default( 'on' )
->add_dependency( 'vendor_capabilities.vendor_capabilities.one_page_creation', 'on', true, 'display', 'show', '===' )
->add_dependency( 'vendor_capabilities.vendor_capabilities.one_page_creation', 'off', true, 'display', 'hide', '!==' )
)
->add(
ElementFactory::field( 'order_status_change', 'switch' )
Expand Down
6 changes: 5 additions & 1 deletion includes/Admin/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function get_pages_data(): array {
*
* @throws \Exception
*/
public function save( array $data ): void {
public function save( array $data, bool $save_old = true ): void {
// Mirror new settings saves back to legacy options as well.
$transformer = new LegacyTransformer();

Expand All @@ -116,6 +116,10 @@ public function save( array $data ): void {
// Save into the new storage for this page
$page->save( $data[ $page_id ] );

if ( ! $save_old ) {
continue;
}

// Also update corresponding legacy options using the mapper/transformer
$legacy = $transformer->transform(
[
Expand Down
Loading