Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
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
15 changes: 15 additions & 0 deletions includes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
public function get_localized_price() {
return [
'precision' => wc_get_price_decimals(),
'symbol' => html_entity_decode( get_woocommerce_currency_symbol() ),

Check failure on line 180 in includes/Assets.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

The default value of the $flags parameter for html_entity_decode() was changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 in PHP 8.1. For cross-version compatibility, the $flags parameter should be explicitly set.
'decimal' => esc_attr( wc_get_price_decimal_separator() ),
'thousand' => esc_attr( wc_get_price_thousand_separator() ),
'position' => esc_attr( get_option( 'woocommerce_currency_pos' ) ),
Expand Down Expand Up @@ -378,6 +378,11 @@
'deps' => [ 'wp-components' ],
'version' => filemtime( DOKAN_DIR . '/assets/css/components.css' ),
],
'dokan-product-form-manager' => [
'src' => DOKAN_PLUGIN_ASSEST . '/js/form-manager.css',
'deps' => [ 'wp-components' ],
'version' => filemtime( DOKAN_DIR . '/assets/js/form-manager.css' ),
],
];

return $styles;
Expand Down Expand Up @@ -692,6 +697,16 @@
];
}

$product_form_manager = DOKAN_DIR . '/assets/js/form-manager.asset.php';
if ( file_exists( $product_form_manager ) ) {
$form_asset = require $product_form_manager;
$scripts['dokan-product-form-manager'] = [
'version' => $form_asset['version'],
'src' => $asset_url . '/js/form-manager.js',
'deps' => array_merge( $form_asset['dependencies'], [ 'dokan-react-components' ] ),
];
}

return $scripts;
}

Expand Down
2 changes: 2 additions & 0 deletions includes/DependencyManagement/Providers/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class ServiceProvider extends BootableServiceProvider {
'widgets' => \WeDevs\Dokan\Widgets\Manager::class,
'admin_notices' => \WeDevs\Dokan\Admin\Notices\Manager::class,
'tracker' => \WeDevs\Dokan\Tracker::class,
'form_fields' => \WeDevs\Dokan\ProductForm\Init::class,
'form_manager' => \WeDevs\Dokan\Product\FormManager::class,
];

/**
Expand Down
Loading
Loading