Jump to content

Prestashop 1.7.4.3 hide lines from contactinfo in footer and contact page


sumsel

Recommended Posts

Hi there,

I would like to hide / remove /  omit a few lines from the contact info that is found in the footer of the shop (module ps_contactinfo). For example the country I would like to take out, is is now an obligatory field so I can't leave it empty. In prestashop 1.6 I just left it empty and it disappeared in frontoffice. I have no problem filling the field in backoffice, but I would like to reduce the number of lines that are displayed in the frontoffice. The same I would like to see in the contact page then.

I tried modifying ps_contactinfo.php in modules but that didn't seem to have any effect.

Is there a trick to achieve that?

Thank you....

Link to comment
Share on other sites

You can (in 1.7.) adjust the responsilble template file (for classic theme in /themes/classic/modules/ps_contactinfo/ps_contactinfo.tpl). Hiding by CSS is not possible as it is one generated text block in 1.7. standard template ({$contact_infos.address.formatted nofilter}).

Link to comment
Share on other sites

  • 3 years later...
On 11/16/2018 at 2:55 PM, JBW said:

You can (in 1.7.) adjust the responsilble template file (for classic theme in /themes/classic/modules/ps_contactinfo/ps_contactinfo.tpl). Hiding by CSS is not possible as it is one generated text block in 1.7. standard template ({$contact_infos.address.formatted nofilter}).

but how to change the format of the address if the variable ($contact_infos.address.formatted) is directly pasted in tpl? 

Link to comment
Share on other sites

7 hours ago, koubin said:

but how to change the format of the address if the variable ($contact_infos.address.formatted) is directly pasted in tpl? 

The $contact_infos variable in the tpl is defined as follows:

$contact_infos = [
            'company' => Configuration::get('PS_SHOP_NAME'),
            'address' => [
                'formatted' => AddressFormat::generateAddress($address, array(), '<br />'),
                'address1' => $address->address1,
                'address2' => $address->address2,
                'postcode' => $address->postcode,
                'city' => $address->city,
                'state' => $is_state_multilang ? $state_name[$this->context->language->id] : $state_name,
                'country' => (new Country($address->id_country))->name[$this->context->language->id],
            ],
            'phone' => Configuration::get('PS_SHOP_PHONE'),
            'fax' => Configuration::get('PS_SHOP_FAX'),
            'email' => Configuration::get('PS_SHOP_EMAIL'),
        ];

So instead of {$contact_infos.address.formatted} you could use for example...

{$contact_infos.address.address1 nofilter}
<br />
{$contact_infos.address.city nofilter}
<br />
{$contact_infos.address.postcode nofilter}

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 8 months later...
On 7/5/2022 at 9:44 AM, lordignus said:

The $contact_infos variable in the tpl is defined as follows:

$contact_infos = [
            'company' => Configuration::get('PS_SHOP_NAME'),
            'address' => [
                'formatted' => AddressFormat::generateAddress($address, array(), '<br />'),
                'address1' => $address->address1,
                'address2' => $address->address2,
                'postcode' => $address->postcode,
                'city' => $address->city,
                'state' => $is_state_multilang ? $state_name[$this->context->language->id] : $state_name,
                'country' => (new Country($address->id_country))->name[$this->context->language->id],
            ],
            'phone' => Configuration::get('PS_SHOP_PHONE'),
            'fax' => Configuration::get('PS_SHOP_FAX'),
            'email' => Configuration::get('PS_SHOP_EMAIL'),
        ];

So instead of {$contact_infos.address.formatted} you could use for example...

{$contact_infos.address.address1 nofilter}
<br />
{$contact_infos.address.city nofilter}
<br />
{$contact_infos.address.postcode nofilter}

 

I was trying to do this for a while until finally your answer saved me. THANK YOU!

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...