Skip to content

Commit

Permalink
fix: setup wizard error
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed Dec 12, 2019
1 parent 09dec8f commit ac5963b
Show file tree
Hide file tree
Showing 14 changed files with 510 additions and 283 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
**Requires at least:** 4.4
**Tested up to:** 5.3.0
**WC requires at least:** 3.0
**WC tested up to:** 3.8.0
**WC tested up to:** 3.8.1
**Requires PHP:** 5.6
**Stable tag:** 2.9.26
**Stable tag:** 2.9.27
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##

### v2.9.27 (December 11, 2019) ###

- **Feat:** Run Dokan Admin Setup Wizard without being WooCommerce installed #708
- **Improvement:** Remove empty div from vendor payment settings page #695
- **Improvement:** Deleting a attribute from predefined attributes and add the attribute again mess up attributes #703
- **Improvement:** Add hooks in order details and admin setup wizard #715
- **Improvement:* Pass post_type as a second parameter to the months_dropdown_results hook #710

### v2.9.26 (November 19, 2019) ###

- **Feat:** Add option to hide out of stock products in best selling widget #697.
Expand Down
3 changes: 2 additions & 1 deletion assets/js/dokan.js
Original file line number Diff line number Diff line change
Expand Up @@ -982,9 +982,10 @@ jQuery(function($) {

$parent.fadeOut( 300, function() {
if ( $parent.is( '.taxonomy' ) ) {
$parent.find( 'select, input[type=text]' ).val( '' );
$( 'select.dokan_attribute_taxonomy' ).find( 'option[value="' + $parent.data( 'taxonomy' ) + '"]' ).removeAttr( 'disabled' );
}
$(this).remove();

Dokan_Editor.attribute.reArrangeAttribute();
});
}
Expand Down
4 changes: 2 additions & 2 deletions assets/js/vue-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3643,7 +3643,7 @@ let Currency = dokan_get_lib('Currency');

this.subscribe.loading = true;

$.ajax({
jQuery.ajax({
url: action,
data: {
EMAIL: this.subscribe.email,
Expand Down Expand Up @@ -4017,7 +4017,7 @@ let Currency = dokan_get_lib('Currency');
if ('paypal' === action) {
let ids = items.join(",");

$.post(ajaxurl, {
jQuery.post(ajaxurl, {
'dokan_withdraw_bulk': 'paypal',
'id': ids,
'action': 'withdraw_ajax_submission',
Expand Down
4 changes: 2 additions & 2 deletions assets/js/vue-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4478,10 +4478,10 @@ _vue2.default.filter('capitalize', function (value) {
// Tooltip directive
_vue2.default.directive('tooltip', {
bind: function bind(el, binding, vnode) {
$(el).tooltip('show');
jQuery(el).tooltip('show');
},
unbind: function unbind(el, binding, vnode) {
$(el).tooltip('destroy');
jQuery(el).tooltip('destroy');
}
});

Expand Down
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
= v2.9.27 (December 11, 2019) =

- **Feat:** Run Dokan Admin Setup Wizard without being WooCommerce installed #708
- **Improvement:** Remove empty div from vendor payment settings page #695
- **Improvement:** Deleting a attribute from predefined attributes and add the attribute again mess up attributes #703
- **Improvement:** Add hooks in order details and admin setup wizard #715
- **Improvement:* Pass post_type as a second parameter to the months_dropdown_results hook #710

= v2.9.26 (November 19, 2019) =

- **Feat:** Add option to hide out of stock products in best selling widget #697.
Expand Down
10 changes: 5 additions & 5 deletions dokan.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Plugin Name: Dokan
Plugin URI: https://wordpress.org/plugins/dokan-lite/
Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
Version: 2.9.26
Version: 2.9.27
Author: weDevs
Author URI: https://wedevs.com/
Text Domain: dokan-lite
WC requires at least: 3.0
WC tested up to: 3.8.0
WC tested up to: 3.8.1
Domain Path: /languages/
License: GPL2
*/
Expand Down Expand Up @@ -78,7 +78,7 @@ final class WeDevs_Dokan {
*
* @var string
*/
public $version = '2.9.26';
public $version = '2.9.27';

/**
* Instance of self
Expand Down Expand Up @@ -533,7 +533,7 @@ public function render_missing_woocommerce_notice() {
/**
* Render run admin setup wizard notice
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand Down Expand Up @@ -597,7 +597,7 @@ public function include_backgorund_processing_files() {
/**
* Handles scenerios when WooCommerce is not active
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand Down
60 changes: 23 additions & 37 deletions includes/admin/setup-wizard-no-wc.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Dokan_Admin_Setup_Wizard_No_WC extends Dokan_Setup_Wizard {
/**
* Set wizard steps
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand All @@ -22,7 +22,7 @@ protected function set_steps() {
/**
* Should show any recommended step
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return bool
*/
Expand All @@ -33,21 +33,27 @@ protected function should_show_recommended_step() {
/**
* Enqueue wizard scripts
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
public function enqueue_scripts() {
wp_register_script( 'jquery-blockui', DOKAN_PLUGIN_ASSEST . '/vendors/jquery-blockui/jquery.blockUI.min.js', array( 'jquery' ), '2.70', true );

wp_enqueue_style( 'dokan-setup', DOKAN_PLUGIN_ASSEST . '/css/setup-no-wc.css', array( 'install' ), DOKAN_PLUGIN_VERSION );

wp_enqueue_script( 'wc-setup', DOKAN_PLUGIN_ASSEST . '/js/dokan-setup-no-wc.js', array( 'jquery', 'jquery-blockui' ), DOKAN_PLUGIN_VERSION, true );
wp_localize_script(
'wc-setup',
'wc_setup_params',
array()
);
}

/**
* Wizard templates
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*/
protected function set_setup_wizard_template() {
$this->setup_wizard_header();
Expand All @@ -58,7 +64,7 @@ protected function set_setup_wizard_template() {
/**
* Setup wizard main content
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand All @@ -76,7 +82,7 @@ public function setup_wizard_content() {
/**
* Setup wizard footer
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand All @@ -91,7 +97,7 @@ public function setup_wizard_footer() {
/**
* Introduction page
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand All @@ -102,7 +108,7 @@ public function step_introduction() {
/**
* Install WooCommerce and redirect to store setup step
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand Down Expand Up @@ -132,7 +138,7 @@ public function install_woocommerce() {
/**
* Get WooCommerce Setup wizard
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @param array $steps
*
Expand All @@ -149,30 +155,10 @@ protected static function get_wc_setup_wizard( $steps = array() ) {
return $setup_wizard;
}

/**
* Helper method to get postcode configurations from `WC()->countries->get_country_locale()`.
*
* @see \WC_Admin_Setup_Wizard::get_postcodes()
*
* @since DOKAN_LITE_SINCE
*
* @return array
*/
protected static function get_postcodes() {
$locales = WC()->countries->get_country_locale();
$postcodes = array();
foreach ( $locales as $country_code => $locale ) {
if ( isset( $locale['postcode'] ) ) {
$postcodes[ $country_code ] = $locale['postcode'];
}
}
return $postcodes;
}

/**
* Add WooCommerce steps in Dokan admin setup wizard
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @param array $steps
*/
Expand Down Expand Up @@ -203,7 +189,7 @@ public static function add_wc_steps_to_wizard( $steps ) {
/**
* Add WC localized scripts
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand All @@ -222,7 +208,7 @@ public static function enqueue_wc_localized_scripts() {
/**
* Add WC fields to Store setup form
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand All @@ -233,7 +219,7 @@ public static function add_wc_html_step_start() {
/**
* Save WC data in store setup step
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand Down Expand Up @@ -278,7 +264,7 @@ public static function save_wc_store_setup_data() {
/**
* WC payment setup step form
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand All @@ -293,7 +279,7 @@ public static function wc_setup_payment() {
/**
* WC payment step post data handler
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @param \Dokan_Setup_Wizard $dokan_admin_setup_wizard
*
Expand All @@ -309,7 +295,7 @@ public static function wc_setup_payment_save( $dokan_admin_setup_wizard ) {
/**
* WC shipping setup step form
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand All @@ -324,7 +310,7 @@ public static function wc_setup_shipping() {
/**
* WC shipping step post data handler
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @param \Dokan_Setup_Wizard $dokan_admin_setup_wizard
*
Expand Down
12 changes: 6 additions & 6 deletions includes/admin/setup-wizard-wc-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Dokan_Admin_Setup_Wizard_WC_Admin extends WC_Admin_Setup_Wizard {
/**
* Current step
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @var string
*/
Expand All @@ -18,7 +18,7 @@ class Dokan_Admin_Setup_Wizard_WC_Admin extends WC_Admin_Setup_Wizard {
/**
* Steps for the setup wizard
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @var array
*/
Expand All @@ -27,7 +27,7 @@ class Dokan_Admin_Setup_Wizard_WC_Admin extends WC_Admin_Setup_Wizard {
/**
* Class constuctor
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @param array $steps
*
Expand All @@ -42,7 +42,7 @@ public function __construct( $steps = array() ) {
/**
* Set current step
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @param string $step
*/
Expand All @@ -55,7 +55,7 @@ public function set_step( $step ) {
*
* @see WC_Admin_Setup_Wizard::wc_setup_shipping Override the input/checkbox only
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @return void
*/
Expand Down Expand Up @@ -349,7 +349,7 @@ class="<?php echo esc_attr( 'payment-' . $setting['type'] . '-input' ); ?>"
* @see WC_Admin_Setup_Wizard::get_next_step_link Without the override, $this in parent class
* will refer to parent class object
*
* @since DOKAN_LITE_SINCE
* @since 2.9.27
*
* @param string $step slug (default: current step).
* @return string URL for next step if a next step exists.
Expand Down
Loading

0 comments on commit ac5963b

Please sign in to comment.