change disable_coupons != yes to enable_coupons == yes

This commit is contained in:
iBNu Maksum 2025-01-07 16:26:33 +07:00
parent 0e302a5171
commit 690e5912c0
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 190 additions and 188 deletions

View File

@ -411,6 +411,7 @@ switch ($action) {
list($bills, $add_cost) = User::getBills($id_customer); list($bills, $add_cost) = User::getBills($id_customer);
} }
if($config['enable_coupons']){
if (!isset($_SESSION['coupon_attempts'])) { if (!isset($_SESSION['coupon_attempts'])) {
$_SESSION['coupon_attempts'] = 0; $_SESSION['coupon_attempts'] = 0;
$_SESSION['last_attempt_time'] = time(); $_SESSION['last_attempt_time'] = time();
@ -495,6 +496,7 @@ switch ($action) {
$ui->assign('notify', Lang::T("Coupon applied successfully. You saved " . Lang::moneyFormat($discount))); $ui->assign('notify', Lang::T("Coupon applied successfully. You saved " . Lang::moneyFormat($discount)));
$ui->assign('notify_t', 's'); $ui->assign('notify_t', 's');
} }
}
$tax = Package::tax($plan['price'] + $add_cost, $tax_rate); $tax = Package::tax($plan['price'] + $add_cost, $tax_rate);
$pgs = array_values(explode(',', $config['payment_gateway'])); $pgs = array_values(explode(',', $config['payment_gateway']));

View File

@ -71,7 +71,7 @@
</li> </li>
</ul> </ul>
{/if} {/if}
{if $discount == '' && $plan['type'] neq 'Balance' && $custom == ''} {if $discount == '' && $plan['type'] neq 'Balance' && $custom == '' && $_c['enable_coupons'] == 'yes'}
<!-- Coupon Code Form --> <!-- Coupon Code Form -->
<form action="{$_url}order/gateway/{$route2}/{$route3}" method="post"> <form action="{$_url}order/gateway/{$route2}/{$route3}" method="post">
<div class="form-group row"> <div class="form-group row">

View File

@ -1272,7 +1272,7 @@
<li {if $_routes[1] eq 'voucher' }class="active" {/if}><a <li {if $_routes[1] eq 'voucher' }class="active" {/if}><a
href="{$_url}plan/voucher">{Lang::T('Vouchers')}</a></li> href="{$_url}plan/voucher">{Lang::T('Vouchers')}</a></li>
{/if} {/if}
{if $_c['disable_coupons'] != 'yes'} {if $_c['enable_coupons'] == 'yes'}
<li {if $_routes[0] eq 'coupons' }class="active" {/if}><a <li {if $_routes[0] eq 'coupons' }class="active" {/if}><a
href="{$_url}coupons">{Lang::T('Coupons')}</a></li> href="{$_url}coupons">{Lang::T('Coupons')}</a></li>
{/if} {/if}