Jump to content

Prestashop 1.7 order details page not loading templates from layout


Recommended Posts

I'm using Prestashop 1.7.2.4. I installed a module called Universal Payment Module which is not entirely compatible with Prestashop 1.7.

https://github.com/prestalab/universalpay/tree/ps17

After I select this payment option and I click on "Order with an obligation to pay" I go to the order details page but the page is loaded with unformatted text. Besides, I cannot see any other templates like the header or the footer. After inspecting elements there are no errors in the console, and I don't see anything in the head tag.

Finally, after some tests and comparisons with other modules, I fixed it by adding these codes to the file called payment_execution.tpl:

{extends file='page.tpl'}
{block name="content"}
{/block}

This is the whole file called payment_execution.tpl:

{extends file='page.tpl'} {* added *}
{capture name=path}{$paysistem->name|escape:'htmlall':'UTF-8'}{/capture}
{block name="content"} {* added *}

    <h1 class="page-heading">
        {l s='Order summary' mod='universalpay'}
    </h1>

    {if $nbProducts <= 0}
        <p class="alert alert-warning">
            {l s='Your shopping cart is empty.' mod='universalpay'}
        </p>
    {else}
        <form action="{$link->getModuleLink('universalpay', 'validation', [], true)|escape:'html':'UTF-8'}" method="post">
            <div class="box cheque-box">
                <h3 class="page-subheading">
                    {$paysistem->name|escape:'html':'UTF-8'}
                </h3>
                <p class="cheque-indent">
                    {$paysistem->description nofilter}
                </p>
                <p>
                    <b>{l s='Please confirm your order by clicking "I confirm my order"' mod='universalpay'}.</b>
                </p>
            </div>
            <p class="cart_navigation clearfix" id="cart_navigation">
                <a class="button-exclusive btn btn-default"
                   href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}">
                    <i class="icon-chevron-left"></i>{l s='Other payment methods' mod='universalpay'}
                </a>
                <input type="hidden" name="id_universalpay_system" value="{$paysistem->id|intval}"/>
                <button class="button btn btn-default button-medium" type="submit">
                    <span>{l s='I confirm my order' mod='universalpay'}<i class="icon-chevron-right right"></i></span>
                </button>
            </p>
        </form>
    {/if}

{/block} {* added *}

However, I'm not sure about the use of those codes and if that fix is completely acceptable.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...