Skip to content

Commit

Permalink
Merge pull request #36 from iamsayan/develop
Browse files Browse the repository at this point in the history
added v1.4.2
  • Loading branch information
iamsayan authored Mar 3, 2024
2 parents 06ef6bd + 986dfbe commit e650654
Show file tree
Hide file tree
Showing 8 changed files with 483 additions and 395 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.4.2
Release Date: March 3, 2024

* Fixed: Form not submitting if both fields are hidden.

## 1.4.1
Release Date: January 7, 2024

Expand Down
58 changes: 28 additions & 30 deletions includes/class-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ public function generate_qr_code( $order_id ) {
$show_qr_download = ( wp_is_mobile() && $this->download_qr === 'yes' );

$qr_code_class = ( $hide_mobile_qr ) ? 'upiwc-hide' : 'upiwc-show';
//$show_intent_btn = $show_qr_download = true;
$form_class = ( $this->transaction_id !== 'hide' || $this->transaction_image !== 'hide' ) ? 'upiwc-payment-confirm-form-container' : 'upiwc-payment-confirm-form-container upiwc-hidden';

// add html output on payment endpoint
if ( 'yes' === $this->enabled && $order->needs_payment() === true && $order->has_status( $this->default_status ) && ! empty( $payee_vpa ) ) { ?>
Expand Down Expand Up @@ -744,35 +744,33 @@ public function generate_qr_code( $order_id ) {
<?php } ?>
</div>
<div class="upiwc-payment-confirm" style="display: none;">
<?php if ( $this->transaction_id !== 'hide' || $this->transaction_image !== 'hide' ) { ?>
<div class="upiwc-payment-confirm-form-container">
<form id="upiwc-payment-confirm-form" class="upiwc-payment-confirm-form">
<?php if ( $this->transaction_id !== 'hide' ) { ?>
<div class="upiwc-form-row">
<label for="upiwc-payment-transaction-number">
<strong><?php esc_html_e( 'Enter 12-digit Transaction / UTR / Reference ID:', 'upi-qr-code-payment-for-woocommerce' ); ?></strong>
<?php if ( $this->transaction_id === 'show_require' ) { ?>
<span class="field-required">*</span>
<?php } ?>
</label>
<input type="text" id="upiwc-payment-transaction-number" name="upiwc_transaction_id" maxlength="12" onkeypress="return upiwcIsNumber(event)" />
</div>
<?php } ?>
<?php if ( $this->transaction_image !== 'hide' ) { ?>
<div class="upiwc-form-row">
<label for="upiwc-payment-file">
<strong><?php esc_html_e( 'Upload Screenshot:', 'upi-qr-code-payment-for-woocommerce' ); ?></strong>
<?php if ( $this->transaction_image === 'show_require' ) { ?>
<span class="field-required">*</span>
<?php } ?>
</label>
<input type="file" id="upiwc-payment-file" name="upiwc_file" accept=".jpg, .jpeg, .png," />
</div>
<?php } ?>
</form>
<div class="upiwc-payment-error" style="display: none;"></div>
</div>
<?php } ?>
<div class="<?php echo esc_attr( $form_class ); ?>">
<form id="upiwc-payment-confirm-form" class="upiwc-payment-confirm-form">
<?php if ( $this->transaction_id !== 'hide' ) { ?>
<div class="upiwc-form-row">
<label for="upiwc-payment-transaction-number">
<strong><?php esc_html_e( 'Enter 12-digit Transaction / UTR / Reference ID:', 'upi-qr-code-payment-for-woocommerce' ); ?></strong>
<?php if ( $this->transaction_id === 'show_require' ) { ?>
<span class="field-required">*</span>
<?php } ?>
</label>
<input type="text" id="upiwc-payment-transaction-number" name="upiwc_transaction_id" maxlength="12" onkeypress="return upiwcIsNumber(event)" />
</div>
<?php } ?>
<?php if ( $this->transaction_image !== 'hide' ) { ?>
<div class="upiwc-form-row">
<label for="upiwc-payment-file">
<strong><?php esc_html_e( 'Upload Screenshot:', 'upi-qr-code-payment-for-woocommerce' ); ?></strong>
<?php if ( $this->transaction_image === 'show_require' ) { ?>
<span class="field-required">*</span>
<?php } ?>
</label>
<input type="file" id="upiwc-payment-file" name="upiwc_file" accept=".jpg, .jpeg, .png," />
</div>
<?php } ?>
</form>
<div class="upiwc-payment-error" style="display: none;"></div>
</div>
<div class="upiwc-payment-confirm-text"><?php echo $this->confirm_message; ?></div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion includes/css/payment.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions includes/css/payment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@
flex-direction: column;
gap: 15px;

&.upiwc-hidden {
display: none;
}

.upiwc-payment-confirm-form {
display: flex;
flex-direction: column;
Expand Down
Loading

0 comments on commit e650654

Please sign in to comment.