Skip to content

Commit f1873f6

Browse files
authored
Merge pull request #1400 from laterpay/GH-1397
GH-1397 Allows Less than 6 digit voucher code
2 parents 7909afa + 059fb81 commit f1873f6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

laterpay/application/Helper/Voucher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public static function get_all_global_vouchers() {
327327
$vouchers = get_option( self::GLOBAL_VOUCHER_CODES_OPTION );
328328
if ( ! $vouchers || ! is_array( $vouchers ) ) {
329329
update_option( self::GLOBAL_VOUCHER_CODES_OPTION, '' );
330-
$vouchers = [];
330+
$vouchers = [ [] ]; // Ticket #1397.
331331
}
332332

333333
// format prices.

laterpay/asset_sources/js/laterpay-backend-pricing.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,8 @@
692692
validateVoucherCode = function( voucherInput, $wrapper, type ) {
693693
var voucherCode = voucherInput.val();
694694

695-
if (voucherCode.length === 6) {
696-
695+
// Allows less than 6 Characters #1397
696+
if (voucherCode.length <= 6) {
697697
var globalVouchers = $o.globalVouchers.data.vouchers;
698698
if ( typeof $o.globalVouchers.data.vouchers === 'string' ) {
699699
globalVouchers = JSON.parse($o.globalVouchers.data.vouchers);

0 commit comments

Comments
 (0)