Invertus / saferpayofficial

Saferpay Official
1 stars 2 forks source link

Cannot override MyAccount.tpl in theme #167

Open Djohel opened 5 months ago

Djohel commented 5 months ago

In the hookDisplayCustomerAccount method line 348, the template path is currently set to:

$this->getLocalPath() . 'views/templates/hook/front/MyAccount.tpl' This prevents us from being able to override the template. Instead, it should be set to:

'module:saferpayofficial/views/templates/hook/front/MyAccount.tpl' This change would allow us to properly override the template as needed.

below the function changed :

public function hookDisplayCustomerAccount()
    {
        $isCreditCardSaveEnabled =
            Configuration::get(\Invertus\SaferPay\Config\SaferPayConfig::CREDIT_CARD_SAVE);
        if (!$isCreditCardSaveEnabled) {
            return;
        }
        if (\Invertus\SaferPay\Config\SaferPayConfig::isVersion17()) {
            return $this->context->smarty->fetch(
                // $this->getLocalPath() . 'views/templates/hook/front/MyAccount.tpl'
                'module:saferpayofficial/views/templates/hook/front/MyAccount.tpl'
            );
        }

        return $this->context->smarty->fetch(
            // $this->getLocalPath() . 'views/templates/hook/front/MyAccount_16.tpl'
            'module:saferpayofficial/views/templates/hook/front/MyAccount_16.tpl'
        );
    }

Thanks !

justelis22 commented 5 months ago

Hi there @Djohel, thanks for waiting!

Thank you for the information, we will check with our team and implement a possible fix.

I will keep you updated about the progress.

Best Regards, Invertus Support team.