Skip to content

Commit

Permalink
Revision: 47 - If no customer is logged in, the "save card" option is…
Browse files Browse the repository at this point in the history
… not displayed.
  • Loading branch information
presteamshop committed Oct 9, 2024
1 parent 6c2bac1 commit 8072e84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions monei.php
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,10 @@ private function getPaymentMethods()
]);
}

$this->context->smarty->assign([
'isCustomerLogged' => Validate::isLoadedObject($this->context->customer) ? true : false,
]);

$paymentOptionList['card']['additionalInformation'] = $this->fetch('module:monei/views/templates/front/onsite_card.tpl');
$paymentOptionList['card']['binary'] = true;
}
Expand Down
10 changes: 6 additions & 4 deletions views/templates/front/onsite_card.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<div id="monei-card_container" class="form-control"></div>
</div>
<div id="monei-card-errors" class="form-group"></div>
<div class="form-group">
<input class="input-form" type="checkbox" name="monei-tokenize-card" id="monei-tokenize-card">
<label class="form-control-label monei-tokenize-card" for="monei-tokenize-card">{l s='Save Card details for future payments' mod='monei'}</label>
</div>
{if $isCustomerLogged}
<div class="form-group">
<input class="input-form" type="checkbox" name="monei-tokenize-card" id="monei-tokenize-card">
<label class="form-control-label monei-tokenize-card" for="monei-tokenize-card">{l s='Save Card details for future payments' mod='monei'}</label>
</div>
{/if}

0 comments on commit 8072e84

Please sign in to comment.