See https://github.com/PrestaShop/PrestaShop/pull/21654/files/58878162576eb30dc4a72e8075359a1bb42fd7bd
Presta Developers already fixed this for Milestone 1.7.8
replace
{if $selected_payment_option == $option.id || $is_free} checked {/if}
with
{if ($selected_payment_option == $option.id || $is_free) || ($payment_options|@count === 1 && $module_options|@count === 1)} checked {/if}
in /themes/YOURTHEME(_CHILD)/templates/checkout/_partials/steps/payment.tpl
that´s it 😉
---
But they missed the additionalInformation to open too. 😒
So you might use this code instead:
{if ($selected_payment_option == $option.id || (isset($is_free) && $is_free) ) || ($payment_options|@count === 1 && $module_options|@count === 1)} checked {$selected_payment_option = $option.id} {/if}
and add this else condition in the class :
{if $option.additionalInformation} <div id="{$option.id}-additional-information" class="js-additional-information definition-list additional-information {if $option.id != $selected_payment_option} ps-hidden {else} ps-shown-by-js {/if}" > {$option.additionalInformation nofilter} </div> {/if}
Works fine for me in PS 1.7.7.2 😊
cheers