Skip to content

Commit e650654

Browse files
authored
Merge pull request #36 from iamsayan/develop
added v1.4.2
2 parents 06ef6bd + 986dfbe commit e650654

File tree

8 files changed

+483
-395
lines changed

8 files changed

+483
-395
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## 1.4.2
5+
Release Date: March 3, 2024
6+
7+
* Fixed: Form not submitting if both fields are hidden.
8+
49
## 1.4.1
510
Release Date: January 7, 2024
611

includes/class-payment.php

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ public function generate_qr_code( $order_id ) {
649649
$show_qr_download = ( wp_is_mobile() && $this->download_qr === 'yes' );
650650

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

654654
// add html output on payment endpoint
655655
if ( 'yes' === $this->enabled && $order->needs_payment() === true && $order->has_status( $this->default_status ) && ! empty( $payee_vpa ) ) { ?>
@@ -744,35 +744,33 @@ public function generate_qr_code( $order_id ) {
744744
<?php } ?>
745745
</div>
746746
<div class="upiwc-payment-confirm" style="display: none;">
747-
<?php if ( $this->transaction_id !== 'hide' || $this->transaction_image !== 'hide' ) { ?>
748-
<div class="upiwc-payment-confirm-form-container">
749-
<form id="upiwc-payment-confirm-form" class="upiwc-payment-confirm-form">
750-
<?php if ( $this->transaction_id !== 'hide' ) { ?>
751-
<div class="upiwc-form-row">
752-
<label for="upiwc-payment-transaction-number">
753-
<strong><?php esc_html_e( 'Enter 12-digit Transaction / UTR / Reference ID:', 'upi-qr-code-payment-for-woocommerce' ); ?></strong>
754-
<?php if ( $this->transaction_id === 'show_require' ) { ?>
755-
<span class="field-required">*</span>
756-
<?php } ?>
757-
</label>
758-
<input type="text" id="upiwc-payment-transaction-number" name="upiwc_transaction_id" maxlength="12" onkeypress="return upiwcIsNumber(event)" />
759-
</div>
760-
<?php } ?>
761-
<?php if ( $this->transaction_image !== 'hide' ) { ?>
762-
<div class="upiwc-form-row">
763-
<label for="upiwc-payment-file">
764-
<strong><?php esc_html_e( 'Upload Screenshot:', 'upi-qr-code-payment-for-woocommerce' ); ?></strong>
765-
<?php if ( $this->transaction_image === 'show_require' ) { ?>
766-
<span class="field-required">*</span>
767-
<?php } ?>
768-
</label>
769-
<input type="file" id="upiwc-payment-file" name="upiwc_file" accept=".jpg, .jpeg, .png," />
770-
</div>
771-
<?php } ?>
772-
</form>
773-
<div class="upiwc-payment-error" style="display: none;"></div>
774-
</div>
775-
<?php } ?>
747+
<div class="<?php echo esc_attr( $form_class ); ?>">
748+
<form id="upiwc-payment-confirm-form" class="upiwc-payment-confirm-form">
749+
<?php if ( $this->transaction_id !== 'hide' ) { ?>
750+
<div class="upiwc-form-row">
751+
<label for="upiwc-payment-transaction-number">
752+
<strong><?php esc_html_e( 'Enter 12-digit Transaction / UTR / Reference ID:', 'upi-qr-code-payment-for-woocommerce' ); ?></strong>
753+
<?php if ( $this->transaction_id === 'show_require' ) { ?>
754+
<span class="field-required">*</span>
755+
<?php } ?>
756+
</label>
757+
<input type="text" id="upiwc-payment-transaction-number" name="upiwc_transaction_id" maxlength="12" onkeypress="return upiwcIsNumber(event)" />
758+
</div>
759+
<?php } ?>
760+
<?php if ( $this->transaction_image !== 'hide' ) { ?>
761+
<div class="upiwc-form-row">
762+
<label for="upiwc-payment-file">
763+
<strong><?php esc_html_e( 'Upload Screenshot:', 'upi-qr-code-payment-for-woocommerce' ); ?></strong>
764+
<?php if ( $this->transaction_image === 'show_require' ) { ?>
765+
<span class="field-required">*</span>
766+
<?php } ?>
767+
</label>
768+
<input type="file" id="upiwc-payment-file" name="upiwc_file" accept=".jpg, .jpeg, .png," />
769+
</div>
770+
<?php } ?>
771+
</form>
772+
<div class="upiwc-payment-error" style="display: none;"></div>
773+
</div>
776774
<div class="upiwc-payment-confirm-text"><?php echo $this->confirm_message; ?></div>
777775
</div>
778776
</div>

includes/css/payment.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/css/payment.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@
343343
flex-direction: column;
344344
gap: 15px;
345345

346+
&.upiwc-hidden {
347+
display: none;
348+
}
349+
346350
.upiwc-payment-confirm-form {
347351
display: flex;
348352
flex-direction: column;

0 commit comments

Comments
 (0)