Jump to content

How to disable Credit Slip link in footer


Recommended Posts

Hello everyone. New to Prestashop. Currently using version 1.7. Currently in the process of editing the footer. It appears there are two columns. I am using the Link Widget to modify. For my linkblock configuration, I have Displayfooter on the left and displaynav1 on the right. I have edited the link options for displayfooter to my needs on the left, but it's the right that I cannot seem to find to edit. options. Nothing to disable even by going to Orders > Credit Slips.

Appreciate the help. Please keep in mind I am a new to this, so basic instructions would be a huge help for me.

LinkWidget.PNG

Footer.PNG

Link to comment
Share on other sites

This is kind of "hardcoded" in the customer account link module (ps_customeraccountlinks.php) so you would have to either override/modify this or you override/modify the corresponding .tpl file e.g. to filter out what you don't want.

    public function getWidgetVariables($hookName = null, array $configuration = [])
    {
        $link = $this->context->link;

        $my_account_urls = array(
            2 => array(
                'title' => $this->trans('Orders', array(), 'Admin.Global'),
                'url' => $link->getPageLink('history', true),
            ),
            3 => array(
                'title' => $this->trans('Credit slips', array(), 'Modules.Customeraccountlinks.Admin'),
                'url' => $link->getPageLink('order-slip', true),
            ),
            4 => array(
                'title' => $this->trans('Addresses', array(), 'Shop.Theme.Global'),
                'url' => $link->getPageLink('addresses', true),
            ),
            0 => array(
                'title' => $this->trans('Personal info', array(), 'Modules.Customeraccountlinks.Admin'),
                'url' => $link->getPageLink('identity', true),
            ),
        );

 

<div id="block_myaccount_infos">
	<h4><a href="{$urls.pages.my_account}" title="{l s='Your account' d='Shop.Theme.Customeraccount'}" rel="nofollow">{l s='Your account' d='Shop.Theme.Customeraccount'}</a></h4>
	<ul>
    {foreach from=$my_account_urls item=my_account_url}
        <li><a href="{$my_account_url.url}" title="{$my_account_url.title}" rel="nofollow">{$my_account_url.title}</a></li>
    {/foreach}
    {hook h="displayMyAccountBlock"}
	</ul>
</div>

 

Link to comment
Share on other sites

5 hours ago, JBW said:

This is kind of "hardcoded" in the customer account link module (ps_customeraccountlinks.php) so you would have to either override/modify this or you override/modify the corresponding .tpl file e.g. to filter out what you don't want.


    public function getWidgetVariables($hookName = null, array $configuration = [])
    {
        $link = $this->context->link;

        $my_account_urls = array(
            2 => array(
                'title' => $this->trans('Orders', array(), 'Admin.Global'),
                'url' => $link->getPageLink('history', true),
            ),
            3 => array(
                'title' => $this->trans('Credit slips', array(), 'Modules.Customeraccountlinks.Admin'),
                'url' => $link->getPageLink('order-slip', true),
            ),
            4 => array(
                'title' => $this->trans('Addresses', array(), 'Shop.Theme.Global'),
                'url' => $link->getPageLink('addresses', true),
            ),
            0 => array(
                'title' => $this->trans('Personal info', array(), 'Modules.Customeraccountlinks.Admin'),
                'url' => $link->getPageLink('identity', true),
            ),
        );

 


<div id="block_myaccount_infos">
	<h4><a href="{$urls.pages.my_account}" title="{l s='Your account' d='Shop.Theme.Customeraccount'}" rel="nofollow">{l s='Your account' d='Shop.Theme.Customeraccount'}</a></h4>
	<ul>
    {foreach from=$my_account_urls item=my_account_url}
        <li><a href="{$my_account_url.url}" title="{$my_account_url.title}" rel="nofollow">{$my_account_url.title}</a></li>
    {/foreach}
    {hook h="displayMyAccountBlock"}
	</ul>
</div>

 

Thank you for the response. I do not completely follow what you have proposed. The second set of html, where do I put that in the .tpl file? I am wanting to disable credit slips (and orders) from the footer. The above html appears to disable all of the my account block/module, correct? Could you please provide what I would need to put in the existing file, to only disable the credit slips? Appreciate your patience and help to rectify.

I also looked into the module, but I do not have a module for customer account. What I do have is "customer account link" that is currently located in column two of my main layout in the footer. If I edit settings, it appears to allow for some CSS to be entered?

Capture.JPG

Link to comment
Share on other sites

Yes, Customer Account Link is the correct module.

I had posted the full code from the .tpl file without any changes just as a reference so you know where to look at. As you posted this in Developer forum I assumed you know how to read and change this code.

Quickest (and dirty) solution is to comment out the lines in the php code (add // in front) you don't want e.g. here for credit slips and orders - please not this is to be re-done in case they update the module.

    public function getWidgetVariables($hookName = null, array $configuration = [])
    {
        $link = $this->context->link;

        $my_account_urls = array(
            //2 => array(
            //    'title' => $this->trans('Orders', array(), 'Admin.Global'),
            //    'url' => $link->getPageLink('history', true),
            //),
            //3 => array(
            //    'title' => $this->trans('Credit slips', array(), 'Modules.Customeraccountlinks.Admin'),
            //    'url' => $link->getPageLink('order-slip', true),
            //),
            4 => array(
                'title' => $this->trans('Addresses', array(), 'Shop.Theme.Global'),
                'url' => $link->getPageLink('addresses', true),
            ),
            0 => array(
                'title' => $this->trans('Personal info', array(), 'Modules.Customeraccountlinks.Admin'),
                'url' => $link->getPageLink('identity', true),
            ),
        );
Edited by JBW (see edit history)
Link to comment
Share on other sites

  • 2 years later...

For hide this option go to the folder themes/classic/templates/customer/page.tpl and find this code:

{if !$configuration.is_catalog}
            <a class="col-lg-4 col-md-6 col-sm-6 col-xs-12" id="order-slips-link" href="{$urls.pages.order_slip}">
          <span class="link-item">
            <i class="fa fa-file-o fa-fw" aria-hidden="true"></i>
            {l s='Credit slips' d='Shop.Theme.Customeraccount'}
          </span>
            </a>
          {/if}

and change for this

{*{if !$configuration.is_catalog}
            <a class="col-lg-4 col-md-6 col-sm-6 col-xs-12" id="order-slips-link" href="{$urls.pages.order_slip}">
          <span class="link-item">
            <i class="fa fa-file-o fa-fw" aria-hidden="true"></i>
            {l s='Credit slips' d='Shop.Theme.Customeraccount'}
          </span>
            </a>
          {/if}*}

or try other way by chose from the left side menu in BO -> Design -> Pages ->

Edited by sieczken
error (see edit history)
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...