Skip to content

Commit

Permalink
fix: withdraw method render dynamically in setup wizard fixed #771
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed Mar 3, 2020
1 parent 4fbcfb6 commit b10ec84
Showing 1 changed file with 17 additions and 38 deletions.
55 changes: 17 additions & 38 deletions includes/Admin/SetupWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,44 +437,23 @@ public function dokan_setup_withdraw() {
<tr>
<td colspan="2">
<ul class="wc-wizard-payment-gateways wc-wizard-services">
<li class="wc-wizard-service-item">
<div class="wc-wizard-service-name">
<p><?php esc_html_e( 'PayPal', 'dokan-lite' ); ?></p>
</div>
<div class="wc-wizard-service-description">
<?php esc_html_e( 'Enable PayPal for your vendor as a withdraw method', 'dokan-lite' ); ?>
</div>
<div class="dokan-wizard-service-enable">
<input type="checkbox" name="withdraw_methods[paypal]" id="withdraw_methods[paypal]" class="switch-input" value="paypal" checked>
<label for="withdraw_methods[paypal]" class="switch-label"></label>
</div>
</li>

<li class="wc-wizard-service-item <?php echo ( array_key_exists( 'paypal', $withdraw_methods ) ) ? 'checked="checked"' : ''; ?>">
<div class="wc-wizard-service-name">
<p><?php esc_html_e( 'Bank', 'dokan-lite' ); ?></p>
</div>
<div class="wc-wizard-service-description">
<?php esc_html_e( 'Enable bank transfer for your vendor as a withdraw method', 'dokan-lite' ); ?>
</div>
<div class="dokan-wizard-service-enable">
<input type="checkbox" name="withdraw_methods[bank]" id="withdraw_methods[bank]" value="bank" class="switch-input" checked>
<label for="withdraw_methods[bank]" class="switch-label"></label>
</div>
</li>

<li class="wc-wizard-service-item <?php echo ( array_key_exists( 'paypal', $withdraw_methods ) ) ? 'checked="checked"' : ''; ?>">
<div class="wc-wizard-service-name">
<p><?php esc_html_e( 'Skrill', 'dokan-lite' ); ?></p>
</div>
<div class="wc-wizard-service-description">
<?php esc_html_e( 'Enable skrill for your vendor as a withdraw method', 'dokan-lite' ); ?>
</div>
<div class="dokan-wizard-service-enable">
<input type="checkbox" name="withdraw_methods[skrill]" id="withdraw_methods[skrill]" value="skrill" class="switch-input" checked>
<label for="withdraw_methods[skrill]" class="switch-label"></label>
</div>
</li>
<?php foreach ( dokan_withdraw_register_methods() as $key => $method ): ?>
<li class="wc-wizard-service-item <?php echo ( in_array( $key, array_values( $withdraw_methods ) ) ) ? 'checked="checked"' : ''; ?>">
<div class="wc-wizard-service-name">
<p><?php echo $method['title']; ?></p>
</div>
<div class="wc-wizard-service-description">
<?php printf(
esc_html__( 'Enable %s for your vendor as a withdraw method', 'dokan-lite' ),
$method['title']
); ?>
</div>
<div class="dokan-wizard-service-enable">
<input type="checkbox" name="withdraw_methods[<?php esc_attr_e( $key ); ?>]" id="withdraw_methods[<?php esc_attr_e( $key ); ?>]" class="switch-input" value="<?php esc_attr_e( $key ); ?>" <?php echo ( in_array( $key, array_values( $withdraw_methods ) ) ) ? 'checked="checked"' : ''; ?>>
<label for="withdraw_methods[<?php esc_attr_e( $key ); ?>]" class="switch-label"></label>
</div>
</li>
<?php endforeach ?>

<?php
/**
Expand Down

0 comments on commit b10ec84

Please sign in to comment.