refactor: show payment method automatically when only option is available

pagebuilder
abhisheks 2024-01-12 11:59:14 +05:30
parent b0ddbb6c23
commit f30766bc04
1 changed files with 5 additions and 3 deletions

View File

@ -21,17 +21,19 @@
{foreach from=$payment_options item="module_options"} {foreach from=$payment_options item="module_options"}
{foreach from=$module_options item="option"} {foreach from=$module_options item="option"}
<div> <div>
<div id="{$option.id}-container" class="payment-option clearfix"> <div id="{$option.id}-container" class="payment-option clearfix
{if ($selected_payment_option == $option.id || (isset($is_free) && $is_free) ) || ($payment_options|@count === 1 && $module_options|@count === 1)} hidden {/if}"
>
{* This is the way an option should be selected when Javascript is enabled *} {* This is the way an option should be selected when Javascript is enabled *}
<span class="custom-radio float-xs-left"> <span class="custom-radio float-xs-left">
<input <input
class="ps-shown-by-js {if $option.binary} binary {/if}" class="ps-shown-by-js {if $option.binary} binary {/if}""
id="{$option.id}" id="{$option.id}"
data-module-name="{$option.module_name}" data-module-name="{$option.module_name}"
name="payment-option" name="payment-option"
type="radio" type="radio"
required required
{if $selected_payment_option == $option.id || $is_free} checked {/if} {if ($selected_payment_option == $option.id || (isset($is_free) && $is_free) ) || ($payment_options|@count === 1 && $module_options|@count === 1)} checked {/if}
> >
<span></span> <span></span>
</span> </span>