From 095e6ebd99c7fe285dadd166ab49f635ba6d5aee Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Fri, 26 Apr 2024 16:37:10 +0600 Subject: [PATCH 001/137] enhance: Update dokan admin logo & add logo update notice. --- assets/src/less/admin.less | 1 + assets/src/less/global-admin.less | 2 +- includes/Admin/Menu.php | 2 +- includes/Admin/Notices/Manager.php | 69 +++++++++++++++++++++++++++--- 4 files changed, 65 insertions(+), 9 deletions(-) diff --git a/assets/src/less/admin.less b/assets/src/less/admin.less index f9b43d347b..d0e330b323 100644 --- a/assets/src/less/admin.less +++ b/assets/src/less/admin.less @@ -12,6 +12,7 @@ .dokan-admin-header-logo { display: flex; + align-items: center; img { height: 25px; diff --git a/assets/src/less/global-admin.less b/assets/src/less/global-admin.less index 027c13c30b..3c713b857c 100644 --- a/assets/src/less/global-admin.less +++ b/assets/src/less/global-admin.less @@ -111,7 +111,7 @@ .dokan-logo { width: 60px; height: 60px; - background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 62 62' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='.90723' y='.79541' width='61' height='61' rx='30.5' fill='%23F16982'/%3E%3Cpath d='m19.688 25.014v-6.1614c1.4588-0.0303 7.7804 0.0301 13.407 3.6546-0.5844-0.2658-1.2264-0.4219-1.8846-0.4584-0.6581-0.0364-1.3177 0.0477-1.9361 0.2469-1.4936 0.5135-2.7441 1.8122-2.8483 3.2016-0.1737 2.3861 0 4.8627 0 7.2488v7.2186c-1.1115 0.0906-2.2577 0.1208-3.2649 0.1208-1.0768 0.0302-2.1188 0.0302-2.9524 0.1208l-0.521 0.0907v-15.283z' fill='%23fff'/%3E%3Cpath d='m17.848 43.77s-0.278-2.3257 2.5007-2.6579c2.7787-0.3323 8.0583 0.302 11.532-1.6008 0 0 2.0494-0.9363 2.4662-1.3893l-0.5558 1.6309s-1.6325 4.9534-6.5994 5.5876c-4.967 0.6041-5.9048-1.7517-9.3434-1.5705z' fill='%23fff'/%3E%3Cpath d='m28.546 45.824c3.9596-0.8457 8.4404-3.3828 8.4404-16.159 0-12.776-17.02-11.689-17.02-11.689 4.0639-2.084 25.008-4.6815 25.008 13.32 0 17.971-16.429 14.528-16.429 14.528z' fill='%23fff'/%3E%3C/svg%3E"); + background-image: url("data:image/svg+xml,%3Csvg width='201' height='201' viewBox='0 0 201 201' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.944824' y='0.286865' width='200' height='200' rx='100' fill='url(%23paint0_linear_1000_463)'/%3E%3Crect x='0.944824' y='0.286865' width='200' height='200' rx='100' fill='url(%23paint1_linear_1000_463)'/%3E%3Cpath opacity='0.5' d='M120.094 97.8397C120.017 116.945 111.818 136.669 94.8784 145.642C82.9666 151.984 54.8115 156.857 54.8115 136.205C54.8115 136.205 54.8115 59.3972 54.8115 59.3198C54.8115 47.8721 64.4802 44.082 74.1488 44.6235C88.5358 45.397 102.304 52.1263 110.658 64.5022C115.995 72.3919 118.934 81.9058 119.862 91.4971C119.94 93.6629 120.094 95.7513 120.094 97.8397Z' fill='white'/%3E%3Cpath d='M146.78 91.1102C145.155 75.331 135.487 62.1042 122.105 54.1373C113.842 49.1791 103.642 47.6922 97.5842 56.0645C96.6338 57.3779 95.8894 58.8748 95.1173 60.3003C88.6566 72.2286 57.2433 129.954 57.2093 130.017C57.2081 130.019 57.2087 130.018 57.2075 130.02C53.8062 136.284 54.5799 141.465 57.6734 145.719C62.3143 152.061 71.5189 154.923 79.0217 155.697C85.9832 156.47 93.022 155.697 99.7514 154.15C120.094 149.509 138.117 135.663 144.227 115.553C146.625 107.663 147.631 99.3866 146.78 91.1102Z' fill='white'/%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_1000_463' x1='100.945' y1='0.286865' x2='100.945' y2='200.287' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23FF7D92'/%3E%3Cstop offset='0.229167' stop-color='%23E3397D'/%3E%3Cstop offset='0.635417' stop-color='%23800CD2'/%3E%3Cstop offset='1' stop-color='%235812D0'/%3E%3C/linearGradient%3E%3ClinearGradient id='paint1_linear_1000_463' x1='100.945' y1='0.286865' x2='100.945' y2='200.287' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23FF7D92'/%3E%3Cstop offset='0.229167' stop-color='%23E3397D'/%3E%3Cstop offset='0.635417' stop-color='%23800CD2'/%3E%3Cstop offset='1' stop-color='%235812D0'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: cover; background-position: center; diff --git a/includes/Admin/Menu.php b/includes/Admin/Menu.php index 87b7e01fc4..8ef39e3673 100644 --- a/includes/Admin/Menu.php +++ b/includes/Admin/Menu.php @@ -40,7 +40,7 @@ public function add_admin_menu() { $withdraw_text = sprintf( __( 'Withdraw %s', 'dokan-lite' ), '' . $withdraw['pending'] . '' ); } - $dashboard = add_menu_page( __( 'Dokan', 'dokan-lite' ), __( 'Dokan', 'dokan-lite' ), $capability, $slug, [ $this, 'dashboard' ], 'data:image/svg+xml;base64,' . base64_encode( '' ), $menu_position ); + $dashboard = add_menu_page( __( 'Dokan', 'dokan-lite' ), __( 'Dokan', 'dokan-lite' ), $capability, $slug, [ $this, 'dashboard' ], 'data:image/svg+xml;base64,' . base64_encode( '' ), $menu_position ); if ( current_user_can( $capability ) ) { $submenu[ $slug ][] = [ __( 'Dashboard', 'dokan-lite' ), $capability, 'admin.php?page=' . $slug . '#/' ]; diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index 2eac5e9bea..1deeba8dcf 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -48,7 +48,9 @@ private function init_hooks() { add_action( 'admin_notices', [ $this, 'render_missing_woocommerce_notice' ] ); add_action( 'admin_notices', [ $this, 'render_global_admin_notices_html' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_permalink_setting_notice' ] ); + add_filter( 'dokan_admin_notices', [ $this, 'show_admin_logo_update_notice' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_one_step_product_add_notice' ] ); + add_action( 'wp_ajax_dismiss_dokan_admin_logo_update_notice', [ $this, 'dismiss_dokan_admin_logo_update_notice' ] ); add_action( 'wp_ajax_dismiss_dokan_one_step_product_notice', [ $this, 'dismiss_dokan_one_step_product_notice' ] ); } @@ -139,12 +141,12 @@ public function show_permalink_setting_notice( $notices ) { public function show_one_step_product_add_notice( $notices ) { if ( 'yes' !== get_option( 'dismiss_dokan_one_step_product_nonce', 'no' ) ) { $notices[] = [ - 'type' => 'alert', - 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), - 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), - 'priority' => 1, + 'priority' => 1, 'show_close_button' => true, - 'ajax_data' => [ + 'type' => 'alert', + 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), + 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), + 'ajax_data' => [ 'action' => 'dismiss_dokan_one_step_product_notice', 'nonce' => wp_create_nonce( 'dismiss_dokan_one_step_product_nonce' ), ], @@ -154,6 +156,33 @@ public function show_one_step_product_add_notice( $notices ) { return $notices; } + /** + * Display dokan admin logo update notice. + * + * @since DOKAN_SINCE + * + * @param array $notices + * + * @return array + */ + public function show_admin_logo_update_notice( array $notices ): array { + if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_nonce', 'no' ) ) { + $notices[] = [ + 'priority' => 1, + 'show_close_button' => true, + 'type' => 'info', + 'title' => __( 'New Dokan Logo!', 'dokan-lite' ), + 'description' => __( 'Introducing our fresh new logo! Keep an eye for out for it in your admin dashboard.', 'dokan-lite' ), + 'ajax_data' => [ + 'action' => 'dismiss_dokan_admin_logo_update_notice', + 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_nonce' ), + ], + ]; + } + + return $notices; + } + /** * Dismisses one-step product create notice. * @@ -162,7 +191,33 @@ public function show_one_step_product_add_notice( $notices ) { * @return void */ public function dismiss_dokan_one_step_product_notice() { - if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), 'dismiss_dokan_one_step_product_nonce' ) ) { + // Check nonce actions, permissions & dismiss dokan admin logo notice. + $this->dismiss_notice( 'dismiss_dokan_one_step_product_nonce' ); + } + + /** + * Dismisses dokan admin logo update notice. + * + * @since DOKAN_SINCE + * + * @return void + */ + public function dismiss_dokan_admin_logo_update_notice() { + // Check nonce actions, permissions & dismiss dokan admin logo notice. + $this->dismiss_notice( 'dismiss_dokan_admin_logo_nonce' ); + } + + /** + * Dismisses dokan notice. + * + * @since DOKAN_SINCE + * + * @param string $option_name The name of the option to update. + * + * @return void + */ + private function dismiss_notice( string $option_name ) { + if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name ) ) { wp_send_json_error( __( 'Invalid nonce', 'dokan-lite' ) ); } @@ -171,7 +226,7 @@ public function dismiss_dokan_one_step_product_notice() { wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } - update_option( 'dismiss_dokan_one_step_product_nonce', 'yes' ); + update_option( $option_name, 'yes' ); wp_send_json_success(); } } From 6775f6de6e22d79b93d63d76ebb203a4347d349b Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Fri, 26 Apr 2024 16:45:24 +0600 Subject: [PATCH 002/137] add: updated admin dashboard logo png --- assets/images/dokan-logo.png | Bin 3613 -> 3578 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/images/dokan-logo.png b/assets/images/dokan-logo.png index ea81c5bb1c9bc55a69a31d6511b0a5cf1d45e90c..ba298c67cdd3c7a92fd8f94fc15a2d8e18017bba 100644 GIT binary patch literal 3578 zcmVAaoV^A` zQBJInC`dM!$Q+P+6D1--iI+qoVu1C*aP0N_tkSe>|pNjl{(g&hY_`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I)LUi*!=;tJ;t}lyxvLYyG=Q;i z=xD26%YrlC)grD;41;3x9#vhMu!X@e&Eg~+rodWRTZ)Cgvlfd5!?Z}F!l8hGWHSp{ jl(oWJGcrs_2qFFtdXkJ`8G9aT00000NkvXXu0mjfdA-n_ From 0da43369d67e7e1107ec8d2102f29784245233bb Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Thu, 2 May 2024 12:36:46 +0600 Subject: [PATCH 003/137] update: logo update nonce name, comments position, update notice description & remove one-step notice. --- includes/Admin/Notices/Manager.php | 56 +++++------------------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index 1deeba8dcf..b8c5e7176b 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -49,9 +49,7 @@ private function init_hooks() { add_action( 'admin_notices', [ $this, 'render_global_admin_notices_html' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_permalink_setting_notice' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_admin_logo_update_notice' ] ); - add_filter( 'dokan_admin_notices', [ $this, 'show_one_step_product_add_notice' ] ); add_action( 'wp_ajax_dismiss_dokan_admin_logo_update_notice', [ $this, 'dismiss_dokan_admin_logo_update_notice' ] ); - add_action( 'wp_ajax_dismiss_dokan_one_step_product_notice', [ $this, 'dismiss_dokan_one_step_product_notice' ] ); } /** @@ -129,33 +127,6 @@ public function show_permalink_setting_notice( $notices ) { return $notices; } - /** - * Display single page product page create notice. - * - * @since 3.8.2 - * - * @param array $notices - * - * @return array - */ - public function show_one_step_product_add_notice( $notices ) { - if ( 'yes' !== get_option( 'dismiss_dokan_one_step_product_nonce', 'no' ) ) { - $notices[] = [ - 'priority' => 1, - 'show_close_button' => true, - 'type' => 'alert', - 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), - 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), - 'ajax_data' => [ - 'action' => 'dismiss_dokan_one_step_product_notice', - 'nonce' => wp_create_nonce( 'dismiss_dokan_one_step_product_nonce' ), - ], - ]; - } - - return $notices; - } - /** * Display dokan admin logo update notice. * @@ -166,16 +137,16 @@ public function show_one_step_product_add_notice( $notices ) { * @return array */ public function show_admin_logo_update_notice( array $notices ): array { - if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_nonce', 'no' ) ) { + if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_update_notice', 'no' ) ) { $notices[] = [ 'priority' => 1, 'show_close_button' => true, 'type' => 'info', 'title' => __( 'New Dokan Logo!', 'dokan-lite' ), - 'description' => __( 'Introducing our fresh new logo! Keep an eye for out for it in your admin dashboard.', 'dokan-lite' ), + 'description' => __( 'Introducing the new freshly designed Dokan Logo. Keep an eye on your admin dashboard!!', 'dokan-lite' ), 'ajax_data' => [ 'action' => 'dismiss_dokan_admin_logo_update_notice', - 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_nonce' ), + 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_update_notice_nonce' ), ], ]; } @@ -183,18 +154,6 @@ public function show_admin_logo_update_notice( array $notices ): array { return $notices; } - /** - * Dismisses one-step product create notice. - * - * @since 3.8.2 - * - * @return void - */ - public function dismiss_dokan_one_step_product_notice() { - // Check nonce actions, permissions & dismiss dokan admin logo notice. - $this->dismiss_notice( 'dismiss_dokan_one_step_product_nonce' ); - } - /** * Dismisses dokan admin logo update notice. * @@ -203,8 +162,7 @@ public function dismiss_dokan_one_step_product_notice() { * @return void */ public function dismiss_dokan_admin_logo_update_notice() { - // Check nonce actions, permissions & dismiss dokan admin logo notice. - $this->dismiss_notice( 'dismiss_dokan_admin_logo_nonce' ); + $this->dismiss_notice( 'dismiss_dokan_admin_logo_update_notice' ); } /** @@ -217,15 +175,17 @@ public function dismiss_dokan_admin_logo_update_notice() { * @return void */ private function dismiss_notice( string $option_name ) { - if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name ) ) { + // Check nonce actions. + if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name . '_nonce' ) ) { wp_send_json_error( __( 'Invalid nonce', 'dokan-lite' ) ); } - // phpcs:ignore + // Check permission. if ( ! current_user_can( 'manage_woocommerce' ) ) { wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } + // Dismiss dokan admin logo notice. update_option( $option_name, 'yes' ); wp_send_json_success(); } From 30faf7a7751463bac12714852b47998455321b6c Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Thu, 2 May 2024 13:01:02 +0600 Subject: [PATCH 004/137] fix: add phpcs for unknown capability --- includes/Admin/Notices/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index b8c5e7176b..5d5bf7db09 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -181,7 +181,7 @@ private function dismiss_notice( string $option_name ) { } // Check permission. - if ( ! current_user_can( 'manage_woocommerce' ) ) { + if ( ! current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } From 4a8d0c71344b5a5057d2669b8f4d67e5986907e1 Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Tue, 16 Jul 2024 15:05:38 +0600 Subject: [PATCH 005/137] fix: Admin color picker settings/component not working as expected. --- src/admin/components/Fields.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/admin/components/Fields.vue b/src/admin/components/Fields.vue index e38bf30f8e..221372dbb1 100644 --- a/src/admin/components/Fields.vue +++ b/src/admin/components/Fields.vue @@ -280,10 +280,9 @@ @@ -723,6 +722,7 @@ fieldData.is_lite ?? false ); }, + inputValueHandler( name, newValue, oldValue ) { this.fieldValue[ name ] = this.validateInputData( name, newValue, oldValue, this.fieldData ); }, @@ -917,12 +917,15 @@ } }, - setCustomColor( value, key ) { + setCustomColor( value, key, defaultValue ) { if ( ! key ) { return; } - this.fieldData[ key ] = value; + // Regular expression to validate hex color code + const hexPattern = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/; + + this.fieldData[ key ] = hexPattern.test( value ) ? value : defaultValue; }, }, }; From aea060847cb553cf4234d42742c4b03018709cee Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Wed, 17 Jul 2024 16:34:58 +0600 Subject: [PATCH 006/137] fix: Product image closing button alignment issue. --- assets/src/less/products.less | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/assets/src/less/products.less b/assets/src/less/products.less index 199d9f3fa7..3d15775100 100644 --- a/assets/src/less/products.less +++ b/assets/src/less/products.less @@ -540,23 +540,22 @@ a.action-delete { position: absolute; top: 0; - right: 0; color: red; background: rgba(0, 0, 0, 0.6); margin: 0; - padding: 0 3px; font-size: 50px; width: 100%; text-align: center; height: 100%; - padding-top: 25%; font-weight: bold; display: none; } &:hover { a.action-delete { - display: inline-block; + display: flex; + align-items: center; + justify-content: center; } } } @@ -1262,23 +1261,22 @@ a.action-delete { position: absolute; top: 0; - right: 0; color: red; background: rgba(0, 0, 0, 0.6); margin: 0; - padding: 0 3px; font-size: 50px; width: 100%; text-align: center; height: 100%; - padding-top: 25%; font-weight: bold; display: none; } &:hover { a.action-delete { - display: inline-block; + display: flex; + align-items: center; + justify-content: center; } } } @@ -1536,23 +1534,22 @@ a.action-delete { position: absolute; top: 0; - right: 0; color: red; background: rgba(0, 0, 0, 0.6); margin: 0; - padding: 0 3px; font-size: 50px; width: 100%; text-align: center; height: 100%; - padding-top: 25%; font-weight: bold; display: none; } &:hover { a.action-delete { - display: inline-block; + display: flex; + align-items: center; + justify-content: center; } } } From 1e3c06e65adf935ba5cdf6c975747c10e857ae7f Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Sat, 20 Jul 2024 10:29:07 +0600 Subject: [PATCH 007/137] enhance: add hooks in vendor product listing name field for printful badge. --- includes/Product/Hooks.php | 2 +- templates/products/products-listing-row.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/Product/Hooks.php b/includes/Product/Hooks.php index a2c9cb99a2..7c3a80ef82 100644 --- a/includes/Product/Hooks.php +++ b/includes/Product/Hooks.php @@ -409,7 +409,7 @@ public function own_product_not_purchasable_notice() { wc_print_notice( __( 'As this is your own product, the "Add to Cart" button has been removed. Please visit as a guest to view it.', 'dokan-lite' ), 'notice' ); } - + /** * Filter the recipients of the product review notification. * diff --git a/templates/products/products-listing-row.php b/templates/products/products-listing-row.php index 5ddcb3fffc..c568570027 100644 --- a/templates/products/products-listing-row.php +++ b/templates/products/products-listing-row.php @@ -50,12 +50,20 @@ + + - get_title() ); ?> + + + get_title() ); ?> + + get_title() ); ?> + +
From 0b1bd47322c0639f9bc9def596763cc5e7563395 Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Mon, 29 Jul 2024 15:32:49 +0600 Subject: [PATCH 008/137] enhance: Make printful badge compatible with vendor listing page. --- templates/products/edit-product-single.php | 21 ++++++++++++++++ templates/products/products-listing-row.php | 27 ++++++++++++--------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/templates/products/edit-product-single.php b/templates/products/edit-product-single.php index c5e0a6d065..da25d77ef3 100755 --- a/templates/products/edit-product-single.php +++ b/templates/products/edit-product-single.php @@ -148,11 +148,32 @@ } else { esc_html_e( 'Edit Product', 'dokan-lite' ); } + + /** + * Render the contents before product edit status label. + * + * @since DOKAN_PRO_SINCE + * + * @param \WC_Product $product + */ + do_action( 'dokan_before_product_edit_status_label', $product ); ?> + post_status ) ); ?> + + post_status === 'publish' ) : ?> diff --git a/templates/products/products-listing-row.php b/templates/products/products-listing-row.php index c568570027..863b970c26 100644 --- a/templates/products/products-listing-row.php +++ b/templates/products/products-listing-row.php @@ -50,8 +50,6 @@ - - @@ -62,8 +60,6 @@ get_title() ); ?> - -
@@ -108,23 +104,32 @@ '; + $product_type = ''; } elseif ( dokan_get_prop( $product, 'product_type', 'get_type' ) === 'external' ) { - echo ''; + $product_type = ''; } elseif ( dokan_get_prop( $product, 'product_type', 'get_type' ) === 'simple' ) { if ( $product->is_virtual() ) { - echo ''; + $product_type = ''; } elseif ( $product->is_downloadable() ) { - echo ''; + $product_type = ''; } else { - echo ''; + $product_type = ''; } } elseif ( dokan_get_prop( $product, 'product_type', 'get_type' ) === 'variable' ) { - echo ''; + $product_type = ''; } else { // Assuming that we have other types in future - echo ''; + $product_type = ''; } + + /** + * Render product listing product type symbol. + * + * @since DOKAN_SINCE + * + * @param string $product_type + */ + echo apply_filters( 'dokan_product_listing_product_type', $product_type, $product ); ?> From 359309e485275680d81b7a185abb8e5b6510fa5b Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Wed, 7 Aug 2024 09:05:36 +0600 Subject: [PATCH 009/137] fix: Add hooks for printful badge compatibility. --- templates/products/products-listing-row.php | 22 ++++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/templates/products/products-listing-row.php b/templates/products/products-listing-row.php index 1cc8fc9c1e..536cc54921 100644 --- a/templates/products/products-listing-row.php +++ b/templates/products/products-listing-row.php @@ -225,34 +225,32 @@ '; + $product_type = ''; } elseif ( dokan_get_prop( $product, 'product_type', 'get_type' ) === 'external' ) { - echo ''; + $product_type = ''; } elseif ( dokan_get_prop( $product, 'product_type', 'get_type' ) === 'simple' ) { if ( $product->is_virtual() ) { - echo ''; + $product_type = ''; } elseif ( $product->is_downloadable() ) { - echo ''; + $product_type = ''; } else { - echo ''; + $product_type = ''; } } elseif ( dokan_get_prop( $product, 'product_type', 'get_type' ) === 'variable' ) { - echo ''; + $product_type = ''; } else { // Assuming that we have other types in future - echo ''; + $product_type = ''; } /** - * Fire an action to add extra content after product type column in product listing table + * Render product listing product type symbol. * * @since DOKAN_SINCE * - * @param \WC_Product $product Current product. - * - * @return void + * @param string $product_type */ - do_action( 'dokan_product_list_table_after_column_content_type', $product ); + echo apply_filters( 'dokan_product_listing_product_type', $product_type, $product ); ?> From 9e2cfa00aa3236bfacdf366dfadd56a90ab9286d Mon Sep 17 00:00:00 2001 From: Asad Nur Date: Fri, 9 Aug 2024 15:14:28 +0600 Subject: [PATCH 010/137] enhance: Field to field navigation on admin settings --- src/admin/components/Fields.vue | 59 ++++++++++++++++++++++----------- src/admin/pages/Settings.vue | 22 ++++++++++-- src/utils/Mixin.js | 4 +++ 3 files changed, 64 insertions(+), 21 deletions(-) diff --git a/src/admin/components/Fields.vue b/src/admin/components/Fields.vue index 097e138d0c..e3646fdb5f 100644 --- a/src/admin/components/Fields.vue +++ b/src/admin/components/Fields.vue @@ -1,7 +1,7 @@