从Prestashop 1.6(addresses.tpl文件?)中删除发票部分

时间:2017-12-20 07:52:07

标签: prestashop-1.6

我正在尝试删除客户结帐中Prestashop 1.6购物车摘要页面中的客户发票地址部分(参见图片)。

我有一个提示,我需要注释/从 addresses.tpl 文件中删除该框?在主题文件夹中。另外,我需要知道HTML,以避免破坏东西'。

我一直忙于阅读HTML和PHP书籍,但还没有找到我必须做的事情。我只是不知道具体要注释或添加的内容,或者可能是完全错误的文件要编辑。

有人可以帮忙吗?

这是我的addresses.tpl文件中的代码:

{capture name=path}
    <a href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}" title="{l s='My account'}">{l s='My account'}</a>
    <span class="navigation-pipe">{$navigationPipe}</span>
    <span class="navigation_page">{l s='My addresses'}</span>
{/capture}

<h1 class="page-heading">{l s='My addresses'}</h1>

<p>{l s='Please configure your default billing and delivery addresses when placing an order. You may also add additional addresses, which can be useful for sending gifts or receiving an order at your office.'}</p>

{if isset($multipleAddresses) && $multipleAddresses}
    <div class="addresses">
        <p><strong class="dark">{l s='Your addresses are listed below.'}</strong></p>
        <p class="p-indent">{l s='Be sure to update your personal information if it has changed.'}</p>
        {assign var="adrs_style" value=$addresses_style}
        <div class="bloc_adresses row">
            {foreach from=$multipleAddresses item=address name=myLoop}
                <div class="col-xs-12 col-sm-6 address">
                    <ul class="{if $smarty.foreach.myLoop.last}last_item{elseif $smarty.foreach.myLoop.first}first_item{/if}{if $smarty.foreach.myLoop.index % 2} alternate_item{else} item{/if} box">
                        <li>
                            <h3 class="page-subheading">{$address.object.alias}</h3>
                        </li>
                        {foreach from=$address.ordered name=adr_loop item=pattern}
                            {assign var=addressKey value=" "|explode:$pattern}
                            <li>
                                {foreach from=$addressKey item=key name="word_loop"}
                                    <span {if isset($addresses_style[$key])} class="{$addresses_style[$key]}"{/if}>
                                        {$address.formated[$key|replace:',':'']|escape:'html':'UTF-8'}
                                    </span>
                                {/foreach}
                            </li>
                        {/foreach}
                        <li class="address_update">
                            <a class="btn btn-success btn-sm" href="{$link->getPageLink('address', true, null, "id_address={$address.object.id|intval}")|escape:'html':'UTF-8'}" title="{l s='Update'}">
                                <span>
                                    {l s='Update'}
                                    <i class="fa fa-refresh right"></i>
                                </span>
                            </a>
                            <a class="btn btn-danger btn-sm" href="{$link->getPageLink('address', true, null, "id_address={$address.object.id|intval}&delete")|escape:'html':'UTF-8'}" onclick="return confirm('{l s='Are you sure?' js=1}');" title="{l s='Delete'}">
                                <span>
                                    {l s='Delete'}
                                    <i class="fa fa-times right"></i>
                                </span>
                            </a>
                        </li>
                    </ul>
                </div>
                {if $smarty.foreach.myLoop.index % 2 && !$smarty.foreach.myLoop.last} 
                </div>
                <div class="bloc_adresses row">
                {/if}
            {/foreach}
        </div>
    </div>
{else}
    <p class="alert alert-warning">{l s='No addresses are available.'}&nbsp;
        <a href="{$link->getPageLink('address', true)|escape:'html':'UTF-8'}" title="{l s='Add a new address'}">{l s='Add a new address'}</a>
    </p>
{/if}

<div class="clearfix main-page-indent">
    <a href="{$link->getPageLink('address', true)|escape:'html':'UTF-8'}" title="{l s='Add an address'}" class="btn btn-default btn-md icon-right">
        <span>
            {l s='Add a new address'}
        </span>
    </a>
</div>

<ul class="footer_links clearfix">
    <li>
        <a class="btn btn-default btn-sm icon-left" href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}" title="{l s='Back to your account'}">
            <span>
                 {l s='Back to your account'}
            </span>
        </a>
    </li>
    <li>
        <a class="btn btn-default btn-sm icon-left" href="{$base_dir}" title="{l s='Home'}">
            <span>
                {l s='Home'}
            </span>
        </a>
    </li>
</ul>

enter image description here

2 个答案:

答案 0 :(得分:0)

您要查找的正确文件位于文件夹&#34; themes / default-bootstrap&#34;叫&#34; shopping-cart.tpl&#34;。

对你来说,一个很好的解决方案是第516行:

            {foreach from=$formattedAddresses key=k item=address}
            {if $k eq 'invoice'}
            {else}
                <div class="col-xs-12 col-sm-6"{if $k == 'delivery' && !$have_non_virtual_products} style="display: none;"{/if}>
                    <ul class="address {if $address@last}last_item{elseif $address@first}first_item{/if} {if $address@index % 2}alternate_item{else}item{/if} box">
                        <li>
                            <h3 class="page-subheading">
                                {if $k eq 'invoice'}
                                    {l s='Invoice address'}
                                {elseif $k eq 'delivery' && $delivery->id}
                                    {l s='Delivery address'}
                                {/if}
                                {if isset($address.object.alias)}
                                    <span class="address_alias">({$address.object.alias})</span>
                                {/if}
                            </h3>
                        </li>
                        {foreach $address.ordered as $pattern}
                            {assign var=addressKey value=" "|explode:$pattern}
                            {assign var=addedli value=false}
                            {foreach from=$addressKey item=key name=foo}
                            {$key_str = $key|regex_replace:AddressFormat::_CLEANING_REGEX_:""}
                                {if isset($address.formated[$key_str]) && !empty($address.formated[$key_str])}
                                    {if (!$addedli)}
                                        {$addedli = true}
                                        <li><span class="{if isset($addresses_style[$key_str])}{$addresses_style[$key_str]}{/if}">
                                    {/if}
                                    {$address.formated[$key_str]|escape:'html':'UTF-8'}
                                {/if}
                                {if ($smarty.foreach.foo.last && $addedli)}
                                    </span></li>
                                {/if}
                            {/foreach}
                        {/foreach}
                    </ul>
                </div>
                {/if}
            {/foreach}

答案 1 :(得分:0)

从购物车摘要中删除发票箱的解决方案(或者更确切地说是黑客)是在blockpermanentlinks.css文件中添加一些代码。

#block-order-detail .col-xs-12.col-sm-6 .address.item.box,
.order_delivery .col-xs-12.col-sm-6 .address.alternate_item{display:none}
.col-xs-12.col-sm-6 #address_invoice,
.checkbox.addressesAreEquals{visibility:hidden}