Skip to content
Open
Show file tree
Hide file tree
Changes from 192 commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
f0d6e79
feat: Product form custom validation. Added support to settings secti…
devAsadNur Sep 1, 2023
2dbcde1
enhance: Added reset all button to the admin settings component
devAsadNur Sep 4, 2023
bedbe32
fix: Action button was not working
devAsadNur Sep 4, 2023
440dac1
Merge branch 'develop' into feat/product-form-custom-validation
devAsadNur Sep 5, 2023
a55be72
enhance: Added admin settings sub-section column heading support
devAsadNur Sep 7, 2023
bc789b4
enahnce: Added support for disabling field for Switches component
devAsadNur Sep 11, 2023
18057d7
fix: Styling for the settings sub heading column styles
devAsadNur Sep 11, 2023
c391f7b
Updated admin setting reset all link with button
devAsadNur Sep 20, 2023
2f430c9
Added admin settings sub-section toggle button label
devAsadNur Sep 20, 2023
3eb324c
Merge branch 'feat/product-form-custom-validation' into module/form_m…
devAsadNur Oct 9, 2023
9ada0e4
Removed extra sub-sections and moved form manager block to a separete…
devAsadNur Oct 13, 2023
7b36504
Cleaned up some unused codes
devAsadNur Oct 16, 2023
50402b0
refactor: Form manager settings section moved to Dokan Pro
devAsadNur Oct 16, 2023
d17cb3d
fix: Console error on field toggle switching
devAsadNur Nov 6, 2023
d8edffa
Added product types to the admin localized script
devAsadNur Nov 22, 2023
6f0e7f7
Added support for settings section repeater
devAsadNur Nov 28, 2023
9d90ea6
new: added skeleton for product fields feature
nurul-umbhiya Dec 1, 2023
63d0b60
Merge remote-tracking branch 'origin/develop' into refactor/dashboard…
nurul-umbhiya Dec 1, 2023
af756c6
refactor: removed `Add New Product` page and modal related codebase a…
nurul-umbhiya Dec 7, 2023
a634761
refactor: replace action hook: dokan_product_updated with filter hook…
nurul-umbhiya Dec 7, 2023
b869ff8
fix: fixed some minor issues
nurul-umbhiya Dec 7, 2023
2e410e6
Merge remote-tracking branch 'origin/develop' into refactor/dashboard…
nurul-umbhiya Dec 7, 2023
fc5ff41
🔒 chore(Product): add defined( 'ABSPATH' ) || exit; to Hooks.php and …
nurul-umbhiya Dec 8, 2023
62aa976
Merge remote-tracking branch 'origin/develop' into module/form_manager
nurul-umbhiya Dec 11, 2023
70553c5
Merge remote-tracking branch 'origin/refactor/dashboard_products' int…
nurul-umbhiya Dec 11, 2023
bb27153
update: Made general product section mandatory for product form custo…
devAsadNur Dec 12, 2023
7f2f9fb
Localized product fields data and get those from the product editor s…
devAsadNur Dec 15, 2023
dc0d791
enhance: Added asterisk symbol markup for required fields
devAsadNur Dec 26, 2023
870738d
Added missing required asterisk symbol on various fields and removed …
devAsadNur Dec 28, 2023
7475c22
update: Included argument to the 'dokan_product_form_item_created' f…
devAsadNur Dec 28, 2023
7961933
Made the input fields required from HTML end based on admin settings
devAsadNur Dec 29, 2023
f1890fa
Added support for the custom product form fields
devAsadNur Dec 29, 2023
ecdf1c4
fix: Updated input value for product title not remaining if product f…
devAsadNur Jan 3, 2024
00fe573
Added JS support for the image and other media file upload and select
devAsadNur Jan 4, 2024
aee9ca2
Enhance: Added support for date range picker for custom product fields
devAsadNur Jan 8, 2024
04239aa
Fixed date range picker desappearing issue and added support for both…
devAsadNur Jan 9, 2024
19731cb
refactor: Moved scripts related to product custom fields from Dokan L…
devAsadNur Jan 9, 2024
400cc06
new: Added some hooks in vendor dashboard product form templates
devAsadNur Jan 10, 2024
b41f4ea
enhance: Added custom fields support to the predefined product form s…
devAsadNur Jan 10, 2024
0746cd1
enahnce: Added mechanism for preserveform submission data for general…
devAsadNur Jan 11, 2024
0254f10
enhance: Added mechanism for inventory section form data upon product…
devAsadNur Jan 12, 2024
08090af
fix: Wrong value showing on date from, date to, and image thumbnil field
devAsadNur Jan 12, 2024
39ffc81
enhance: Added mechanism for Other Options section form data upon pr…
devAsadNur Jan 12, 2024
8945cb8
enhance: Added mechanism to keep downloadable section form data upon …
devAsadNur Jan 15, 2024
2598b21
Fixed styling issue of vendor dashboard product form shipping section…
devAsadNur Jan 17, 2024
a8491c0
chore: merged develop branch
devAsadNur Jan 18, 2024
889449d
fix: Missing help text for the Others section fields on vendor dashbo…
devAsadNur Jan 22, 2024
c27a0eb
Merge remote-tracking branch 'upstream/develop' into module/form_manager
devAsadNur Feb 2, 2024
afa7080
enhance: Added support for conditional dependent blocks and fields
devAsadNur Feb 9, 2024
e13028e
enhance: Made fields under inventory section conditinally dependent
devAsadNur Feb 9, 2024
acb81d2
fix: Broken style for the custom fields under downloadable section on…
devAsadNur Feb 13, 2024
581a09c
fix: Missing 'Downloadable Options' section on vendor dashboard singl…
devAsadNur Feb 13, 2024
69b8a12
fix: Disappeared price and dolownlad related input fields from vendor…
devAsadNur Feb 14, 2024
645a7ba
enhance: Added support to render product form sections based on produ…
devAsadNur Feb 15, 2024
1e399eb
enhance: Category based custom section support for vendor dashboard p…
devAsadNur Feb 16, 2024
0198461
fix: Rendering category selector multiple times on vendor dashboard p…
devAsadNur Feb 16, 2024
633b521
enhance: Added searching support to the multi-step categories API
devAsadNur Feb 20, 2024
a743cd1
fix: Caching issue for the multi-step categories seaching through API
devAsadNur Feb 22, 2024
929f5bc
refactor: Reverted searching mechanism from the multi-step categories…
devAsadNur Feb 22, 2024
70e2ea0
fix: Wrongly placed asterisk sign for requried general product fields…
devAsadNur Mar 7, 2024
58cbdba
fix: Missing help texts and some styling issues on vendor dashboard g…
devAsadNur Mar 7, 2024
239f504
fix: Tooltip issues on vendor dashboard product form fields
devAsadNur Mar 7, 2024
fa3fb9b
Merge branch 'develop' into module/form_manager
nurul-umbhiya Mar 8, 2024
8b66e38
Merge branch 'develop' into module/form_manager
devAsadNur Mar 20, 2024
1376cc7
enhance: Integrated frontend form validation to the vendor dashboard …
devAsadNur Mar 22, 2024
c4cbc84
fix: Switches on admin settings were can't be enabled after merging w…
devAsadNur Mar 25, 2024
c96ee57
fix: Error message on vendor dashboard product form frontend validation
devAsadNur Mar 29, 2024
dd45805
Remove product create popup javascript code.
Aunshon Apr 2, 2024
8d666bd
Merge branch 'develop' into module/form_manager
devAsadNur Apr 2, 2024
d4563c6
enhance: Handled backend validation for discount schedule date from a…
devAsadNur Apr 2, 2024
c72fef6
Handled downloadable options section fields backend validation based …
devAsadNur Apr 2, 2024
f1f48a9
Handled virtual and shipping related fields backend validation
devAsadNur Apr 2, 2024
ee58880
fix: Discounted price date schedule fields validation issue
devAsadNur Apr 2, 2024
d45b8e7
enhance: Integrated backend conditional validation for stock manager …
devAsadNur Apr 3, 2024
f7ce607
Merge remote-tracking branch 'upstream/module/form_manager' into modu…
devAsadNur Apr 3, 2024
bf36c8d
fix: Product form customizer settings reset button not reseting field…
devAsadNur Apr 15, 2024
a434e13
chore: variation product rewrite
nurul-umbhiya Apr 15, 2024
88cc82b
chore: rewritten product variation related php codes
nurul-umbhiya Apr 18, 2024
229139f
Merge remote-tracking branch 'origin/develop' into module/form_manager
nurul-umbhiya Apr 18, 2024
9e08b18
chore: added assets/js/dokan-tailwind.js file to gitignore
nurul-umbhiya Apr 18, 2024
5750393
Merge remote-tracking branch 'origin/develop' into module/form_manager
nurul-umbhiya Apr 18, 2024
daaaa26
chore: fixed some phpcs related issues
nurul-umbhiya Apr 19, 2024
2c42450
update: added a new property for component class to conditionally hid…
nurul-umbhiya Apr 22, 2024
ec88e80
fix: product type id doesn't match with existing source code, hence P…
nurul-umbhiya Apr 22, 2024
531bc8b
chore: moved attribute related js code to dokan pro
nurul-umbhiya Apr 24, 2024
985684f
fix: textarea populating multiple white spaces
nurul-umbhiya Apr 26, 2024
0c7d55f
Merge remote-tracking branch 'origin/develop' into module/form_manager
nurul-umbhiya Apr 26, 2024
64e16f2
fix: product status not updating according to the admin settings
nurul-umbhiya Apr 26, 2024
599d413
fix: simple subscription product type data not saving to database
nurul-umbhiya Apr 26, 2024
34029c7
core: added a new filter to escape required fields validation
nurul-umbhiya Apr 30, 2024
8082724
chore: removed one step product form notice from admin panel
nurul-umbhiya Apr 30, 2024
e6ea576
fix: Reset all button was not workingon product form admin settings
devAsadNur Apr 30, 2024
cb51e17
Merge branch 'develop' into module/form_manager
devAsadNur Jun 26, 2024
aaee6a1
fix: Modified based on PR review request
devAsadNur Aug 27, 2024
8ee16c2
Merge branch 'develop' into module/form_manager
devAsadNur Aug 27, 2024
693c6de
fix: Fatal error error on activating product form module
devAsadNur Aug 28, 2024
374c796
Merge branch 'develop' into module/form_manager
shashwatahalder01 Aug 28, 2024
3c175da
Update tests for form manager
shashwatahalder01 Aug 28, 2024
654614a
Fix a test
shashwatahalder01 Aug 28, 2024
59aa377
fix: Default category not auto selecting on creating new product
devAsadNur Sep 2, 2024
659e645
Merge remote-tracking branch 'upstream/module/form_manager' into modu…
devAsadNur Sep 2, 2024
02adcbf
Merge branch 'develop' into module/form_manager
devAsadNur Sep 2, 2024
6043469
fix: Return type was incorrect for product manager delete method
devAsadNur Sep 2, 2024
935f03e
Merge branch 'develop' into module/form_manager
devAsadNur Sep 2, 2024
7c0c718
Fix failed test locator
shashwatahalder01 Sep 9, 2024
40b08c6
Merge remote-tracking branch 'upstream/module/form_manager' into modu…
devAsadNur Oct 29, 2024
49825ee
fix: Layout breaking issue of vendor dashboard product shipping input
devAsadNur Oct 30, 2024
e2ef682
update: Product SKU field title in vendor dashboard single product ed…
devAsadNur Oct 30, 2024
4b33118
fix: Product edit page shipping dimension input fields styling issues…
devAsadNur Oct 31, 2024
dd6f3db
refactor: Reverted product variation related dokan pro i18n strings t…
devAsadNur Oct 31, 2024
0e05b17
fix: Product type dropdown was missing on vendor dashboard product ed…
devAsadNur Nov 11, 2024
78eaa59
fix: Vendor dashboard product edit page data saving issues of Dokan P…
devAsadNur Nov 12, 2024
fabbc1a
fix: Undefined variable warning on vendor dashboard product category …
devAsadNur Nov 18, 2024
ec05bc8
refactor: dokan_product_form_fields filter hook moved to product fact…
devAsadNur Nov 22, 2024
cd745e8
Merge branch 'develop' into module/form_manager
devAsadNur Nov 26, 2024
36f4fc2
refactor: Registered ProductForm service provider to container common…
devAsadNur Nov 26, 2024
faae548
new: Introduced DOKAN_TEMPLATE_DIR constant
devAsadNur Nov 26, 2024
38556db
Merge branch 'develop' into module/form_manager
devAsadNur Nov 26, 2024
1c91942
refactor: Action hooks to the edit-product-single template after reso…
devAsadNur Nov 26, 2024
b92694d
fix: Removed extra ending sign of PHP form product edit title
devAsadNur Nov 26, 2024
cd4c744
refactor: Featured image preview on vendor dashbaord product edit page
devAsadNur Nov 27, 2024
2af1fbb
Merge branch 'develop' into module/form_manager
devAsadNur Dec 5, 2024
b13cd3b
refactor: Price and category fiels on vendor dashbaord product edit p…
devAsadNur Dec 5, 2024
a04c74b
Merge remote-tracking branch 'origin/develop' into module/form_manager
devAsadNur Dec 17, 2024
0ecb790
fix: Gallery image restriction was not working
devAsadNur Dec 20, 2024
1c36c1c
refactor: Product meta processor method for gallery image restriction
devAsadNur Dec 20, 2024
f80fd6e
Merge branch 'develop' into module/form_manager
devAsadNur Jan 1, 2025
c68a877
Merge branch 'develop' into module/form_manager
devAsadNur Jan 8, 2025
e31b792
Merge branch 'develop' into module/form_manager
devAsadNur Jan 14, 2025
a442a61
Merge with develop
mrabbani Dec 24, 2025
bf20ff8
fix: merge conflict missing resolution
mrabbani Dec 24, 2025
54bacc6
Merge branch 'develop' into feat/product-form-manager
kzamanbd Dec 29, 2025
35c15d7
Update ServiceProvider.php
kzamanbd Dec 29, 2025
44f9346
Add React-based product form manager
kzamanbd Dec 29, 2025
cfc9e8f
Remove redundant class_exists check for ProductFormFactory
kzamanbd Dec 29, 2025
b7b9a2f
Refactor product form layout and field handling
kzamanbd Dec 30, 2025
e2be1e6
remove compiled assets
kzamanbd Dec 30, 2025
c5b7956
Add tooltip support to product form fields
kzamanbd Dec 30, 2025
3295a30
Migrate ProductForm styles from CSS to SCSS
kzamanbd Dec 31, 2025
0d941b7
Enhance product form: update tooltips, improve layout, and add descri…
kzamanbd Jan 1, 2026
6f6c97a
Refactor form fields into separate components
kzamanbd Jan 1, 2026
f4a41bc
Add left icon support to product form fields and enhance styling
kzamanbd Jan 1, 2026
8b48950
Add product discount scheduling feature and enhance form components
kzamanbd Jan 1, 2026
2531b4b
Add brands field and enhance purchase note UI
kzamanbd Jan 1, 2026
d7c3386
Add FormData helper and enhance product form fields
kzamanbd Jan 2, 2026
55ebd6b
Refactor image field handling in product form
kzamanbd Jan 2, 2026
2a7d556
Refactor product category field name and enhance layout styles for im…
kzamanbd Jan 2, 2026
8098eb0
Refactor script enqueueing in product form and enhance image ID handling
kzamanbd Jan 4, 2026
ad9cc0a
Refactor product form layout management and streamline image field ha…
kzamanbd Jan 5, 2026
882136b
Add GalleryImages component and refactor image handling in product form
kzamanbd Jan 5, 2026
31e48eb
Add global unique ID field to product form and enhance dependency con…
kzamanbd Jan 5, 2026
2023149
Refactor field config logic into factory handlers
kzamanbd Jan 5, 2026
98a9c6b
Refactor dependency condition logic in FieldRenderer
kzamanbd Jan 5, 2026
ddc5007
Enhance product form manager by adding form fields retrieval and scri…
kzamanbd Jan 6, 2026
a6ed119
Refactor form manager to improve layout and field handling
kzamanbd Jan 8, 2026
9a4fe94
Refactor image preview layout and enhance gallery image field styling
kzamanbd Jan 8, 2026
d7ec1a7
Enhance product form manager by adding new product handling and updat…
kzamanbd Jan 8, 2026
470a7fb
Refactor image handling in FeatureImage and GalleryImages components;…
kzamanbd Jan 8, 2026
45b4875
Refactor form manager and field handling logic
kzamanbd Jan 8, 2026
de87e7f
Enhance product form manager to handle new product state and update t…
kzamanbd Jan 9, 2026
9984936
Enhance product form manager to support new product state and integra…
kzamanbd Jan 9, 2026
c053633
Add async select support and improve field dependencies
kzamanbd Jan 9, 2026
742dfbc
Show vendor earnings on price edit and update form layout
kzamanbd Jan 9, 2026
2350ef1
Remove left icon handling from product form fields and update styles …
kzamanbd Jan 9, 2026
6553d2e
Add multiselect field support to form manager
kzamanbd Jan 9, 2026
8ca74f0
Refactor form layout management to dynamically adjust based on window…
kzamanbd Jan 9, 2026
5d1cfb1
Refactor imports and minor component improvements
kzamanbd Jan 9, 2026
f11c34e
Enhance product form manager: refactor brand retrieval, add AJAX save…
kzamanbd Jan 14, 2026
4947ea4
Update sale date callbacks to return Y-m-d format
kzamanbd Jan 14, 2026
8e9cdd2
Pass product args to Dokan product hooks
kzamanbd Jan 14, 2026
c97e240
Add attribute field support to product form manager
kzamanbd Jan 14, 2026
c2bf5eb
Enhance product form manager: add error handling, improve attribute m…
kzamanbd Jan 15, 2026
d250e48
Enhance attribute editing with select all/none and UI tweaks
kzamanbd Jan 15, 2026
5869c0a
Refactor product form handling and script enqueueing
kzamanbd Jan 15, 2026
88f53cf
Enhance product form manager integration and field data
kzamanbd Jan 15, 2026
87e833b
Implement form data factory for initial data generation in product fo…
kzamanbd Jan 15, 2026
0fdc20f
Add form context and improve product form handling with new actions a…
kzamanbd Jan 15, 2026
de2a509
Refactor product form manager templates and hooks
kzamanbd Jan 15, 2026
f249c1a
Refactor TreeSelectEdit to use Select component and enhance option re…
kzamanbd Jan 16, 2026
07d2615
Add vendor earning data to product form manager and enhance UI elements
kzamanbd Jan 16, 2026
6e6281f
Refactor attribute fields to separate section
kzamanbd Jan 16, 2026
6ca66f9
Refactor product form manager and attribute handling
kzamanbd Jan 19, 2026
64358ed
Refactor variation management to use context API
kzamanbd Jan 19, 2026
60e17f5
Refactor SelectEdit component to support tree structure and enhance o…
kzamanbd Jan 20, 2026
398cd1c
Enhance Variation Management: Pass productId to VariationProvider and…
kzamanbd Jan 20, 2026
a73b661
Move product form manager logic to FormManager class
kzamanbd Jan 20, 2026
20198ef
Merge pull request #3052 from getdokan/feat/vendor-product-form-manager
kzamanbd Jan 20, 2026
de26166
Merge branch 'develop' into feat/product-form-manager
kzamanbd Jan 20, 2026
71cf084
Update FormManager.php
kzamanbd Jan 20, 2026
49090f1
Remove TreeSelectPicker component from index export
kzamanbd Jan 20, 2026
fcc2a91
Add hidden scope functionality and AJAX handler for product variations
kzamanbd Jan 20, 2026
8542450
Refactor variation management to use ajaxRequest utility
kzamanbd Jan 20, 2026
c2aecc5
Update shipping meta keys and layout field references
kzamanbd Jan 20, 2026
85c4412
Refactor variation form management to utilize new useVariationLayouts…
kzamanbd Jan 20, 2026
2db663a
Revert product templates and remove edit sections
kzamanbd Jan 21, 2026
fe5deb7
Refactor product edit and shipping styles
kzamanbd Jan 21, 2026
d20e4c6
Merge branch 'develop' into feat/product-form-manager
kzamanbd Jan 21, 2026
bea7712
Refactor product test data and interfaces
kzamanbd Jan 21, 2026
77c44fe
Add form manager action to product edit flow
kzamanbd Jan 21, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ npm-debug.log
.DS_Store
includes/.DS_Store
.idea
.vscode
/includes/.DS_Store
plugin-deploy.sh
secret.json
Expand Down
2 changes: 0 additions & 2 deletions assets/js/vue-admin.js

This file was deleted.

2 changes: 0 additions & 2 deletions assets/js/vue-bootstrap.js

This file was deleted.

6 changes: 5 additions & 1 deletion assets/src/js/product-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,15 @@

setCorrectProductId() {
const productForm = $( '.dokan-product-edit-form' );
if ( ! productForm ) {
if ( ! productForm.length ) {
return;
}
const productId = $( '#dokan_product_id' ).val();

if ( typeof productId === 'undefined' ) {
return;
}

if ( window.history.replaceState ) {
const url = new URL( document.location );
const searchParams = url.searchParams;
Expand Down
8 changes: 8 additions & 0 deletions assets/src/less/dashboard.less
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,14 @@ div.media-sidebar a.edit-attachment{
margin-bottom: 10px;
}
}

.product-edit-container {
span {
&.validation-error {
display: block;
}
}
}
}

div.chart-container > div.chart-placeholder > div.legend {
Expand Down
34 changes: 30 additions & 4 deletions assets/src/less/products.less
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@
}

.product-edit-new-container {
.dokan-hide {
display: none;
}

.dokan-edit-row {
&.dokan-other-options {
margin-bottom: 20px;
Expand Down Expand Up @@ -465,14 +469,36 @@

.dokan-shipping-container {
.dokan-shipping-dimention-options {
margin-bottom: 20px;
input {
margin-bottom: 5px;

.dokan-form-group {
width: 23.3%;
float: left;
margin-right: 2%;

&#dokan-form-group-height {
margin-right: 0;
}

input {
&.dokan-form-control {
width: 100%;
margin-right: 0;
margin-bottom: 0;
}
}
}

input {
&.dokan-form-control {
float: left;
width: 23.3%;
margin-right: 2%;
margin-bottom: 15px;
}

&#_height {
margin-right: 0px;
margin-right: 0;
}
}
}
Expand Down Expand Up @@ -972,7 +998,7 @@

.instruction-inside {
text-align: center;
padding-top: 40px;
padding-top: 80px;
color: #aaa;
}

Expand Down
2 changes: 2 additions & 0 deletions dokan-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @property WeDevs\Dokan\BackgroundProcess\Manager $bg_process Instance of WeDevs\Dokan\BackgroundProcess\Manager class
* @property WeDevs\Dokan\Withdraw\Manager $withdraw Instance of WeDevs\Dokan\Withdraw\Manager class
* @property WeDevs\Dokan\Frontend\Frontend $frontend_manager Instance of \WeDevs\Dokan\Frontend\Frontend class
* @property WeDevs\Dokan\Dashboard\Manager $dashboard Instance of \WeDevs\Dokan\Dashboard\Manager class
* @property WeDevs\Dokan\Registration $registration Instance of WeDevs\Dokan\Registration class
*/
final class WeDevs_Dokan {
Expand Down Expand Up @@ -216,6 +217,7 @@ public function define_constants() {
defined( 'DOKAN_PLUGIN_VERSION' ) || define( 'DOKAN_PLUGIN_VERSION', $this->version );
defined( 'DOKAN_DIR' ) || define( 'DOKAN_DIR', __DIR__ );
defined( 'DOKAN_INC_DIR' ) || define( 'DOKAN_INC_DIR', __DIR__ . '/includes' );
defined( 'DOKAN_TEMPLATE_DIR' ) || define( 'DOKAN_TEMPLATE_DIR', __DIR__ . '/templates' );
defined( 'DOKAN_LIB_DIR' ) || define( 'DOKAN_LIB_DIR', __DIR__ . '/lib' );
defined( 'DOKAN_PLUGIN_ASSEST' ) || define( 'DOKAN_PLUGIN_ASSEST', plugins_url( 'assets', DOKAN_FILE ) );

Expand Down
19 changes: 0 additions & 19 deletions includes/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -664,25 +664,6 @@ public function get_settings_fields() {
'default' => 'automatically',
'tooltip' => __( 'If checked, vendors will have permission to sell immediately after registration. If unchecked, newly registered vendors cannot add products until selling capability is activated manually from admin dashboard.', 'dokan-lite' ),
],
'one_step_product_create' => [
'name' => 'one_step_product_create',
'label' => __( 'One Page Product Creation', 'dokan-lite' ),
'desc' => __( 'Add new product in single page view', 'dokan-lite' ),
'type' => 'switcher',
'default' => 'on',
'tooltip' => __( 'If disabled, instead of a single add product page it will open a pop up window or vendor will redirect to product page when adding new product.', 'dokan-lite' ),
],
'disable_product_popup' => [
'name' => 'disable_product_popup',
'label' => __( 'Disable Product Popup', 'dokan-lite' ),
'desc' => __( 'Disable add new product in popup view', 'dokan-lite' ),
'type' => 'switcher',
'default' => 'off',
'show_if' => [
'dokan_selling.one_step_product_create' => [ 'equal' => 'off' ],
],
'tooltip' => __( 'If disabled, instead of a pop up window vendor will redirect to product page when adding new product.', 'dokan-lite' ),
],
'order_status_change' => [
'name' => 'order_status_change',
'label' => __( 'Order Status Change', 'dokan-lite' ),
Expand Down
39 changes: 0 additions & 39 deletions includes/Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public function __construct() {
add_action( 'wp_ajax_dokan_seller_listing_search', [ $this, 'seller_listing_search' ] );
add_action( 'wp_ajax_nopriv_dokan_seller_listing_search', [ $this, 'seller_listing_search' ] );

add_action( 'wp_ajax_dokan_create_new_product', [ $this, 'create_product' ] );

add_action( 'wp_ajax_custom-header-crop', [ $this, 'crop_store_banner' ] );

add_action( 'wp_ajax_dokan_json_search_products_tags', [ $this, 'dokan_json_search_products_tags' ] );
Expand All @@ -58,43 +56,6 @@ public function __construct() {
add_action( 'wp_ajax_dokan-upgrade-dissmiss', [ $this, 'dismiss_pro_notice' ] );
}

/**
* Create product from popup submission
*
* @since 2.5.0
*
* @return void
*/
public function create_product() {
check_ajax_referer( 'dokan_reviews' );

if ( ! current_user_can( 'dokan_add_product' ) ) {
wp_send_json_error( __( 'You have no permission to do this action', 'dokan-lite' ) );
}

$submited_data = isset( $_POST['postdata'] ) ? wp_unslash( $_POST['postdata'] ) : ''; //phpcs:ignore

parse_str( $submited_data, $postdata );

$response = dokan_save_product( $postdata );

if ( is_wp_error( $response ) ) {
wp_send_json_error( $response->get_error_message() );
}

if ( is_int( $response ) ) {
if ( current_user_can( 'dokan_edit_product' ) ) {
$redirect = dokan_edit_product_url( $response );
} else {
$redirect = dokan_get_navigation_url( 'products' );
}

wp_send_json_success( $redirect );
} else {
wp_send_json_error( __( 'Something wrong, please try again later', 'dokan-lite' ) );
}
}

/**
* Check the availability of shop name.
*
Expand Down
Loading
Loading