Jump to content

contact form store owner details added


Melinda

Recommended Posts

Hi,

Is there a way you can add the store owner's company name, address, city, state, zip, phone, fax, and email address to the top of the contact form using the php variables?

I have used for the address as an example in the themes/*/contact-form.tpl file but thought variables might be better:
{l s='4132 E. 12th St.'}

I want each variable on a separate line if possible.

Thanks!

This code in the thread no longer works in 1.4.0.12. Is there a way to add these contact variables in 1.4.0.12?

Thanks.
Link to comment
Share on other sites

Add the following after line 4 of contact-form.tpl in your theme's directory to get all the address information from the Preferences > Contact tab:

{php}
echo Configuration::get('PS_SHOP_NAME') . '
' .
    Configuration::get('PS_SHOP_ADDR1') . '
' .
    Configuration::get('PS_SHOP_ADDR2') . '
' .
    Configuration::get('PS_SHOP_CITY') . ', ' . Configuration::get('PS_SHOP_STATE') . ', ' . Configuration::get('PS_SHOP_CODE') . '
' .
    Configuration::get('PS_SHOP_COUNTRY') . '
';
{/php}
{l s='Phone:'} {php}echo Configuration::get('PS_SHOP_PHONE');{/php}

{l s='Fax:'} {php}echo Configuration::get('PS_SHOP_FAX');{/php}

Link to comment
Share on other sites

Thanks Rocky! I wonder why prestashop doesn't put these variables in as the default. I get requests for this all the time.

I added:
{l s='Email:'} {php}echo Configuration::get('PS_SHOP_EMAIL')

for the email but how would you make it a live link? I don't think this is needed because customer can fill out the form which they should do...just wanted it for my notes.

Thanks!

Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...

Hello, good information, but not too much useful when it comes to PrestaShop 1.3.6 or 1.3.7 version, the above code will not work, any suggestion will be welcome, we refuse to upgrade to the 1.4 version due to way too much bugs and errors, 1.3.6 is the way to go until PrestaShop roll out with 1.4.1 down the road.

Thanks again for fast reply in advance.

Link to comment
Share on other sites

  • 2 months later...

this is the reason prestashop is not heading well, Even the small problem will have to wait a Year to be solved. I don't know why these days Open source are converting to Source Of Money. They are more focused on their own commercial add ons.

Link to comment
Share on other sites

I've found a way, by using the {literal} code, and add whatever you want to add below it, then close it with {/literal}, legit, and works for me, you can put contact info before the form or after..

Thanks for the developer "responding" to this thread, by ignoring it ugh... I agree, with Open Source, you're on your own. Like me, have to spent weeks customize the mistake and bugs before I can deply the store to production...

Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...
  • 2 weeks later...

Yes, this is crazy... modding a contact form is a very BASIC part of creating a website from a template... why is this so difficult with Prestashop????? I am using 1.4.4.1 and I havent found ANY modding for the contact form... thats just bad form...

Link to comment
Share on other sites

  • 2 months later...

Hi,

This worked for me:

 

extend the contactcontrollercore, that means create a new file override\controllers\ContactController.php with the code:

 

<?php

class ContactController extends ContactControllerCore

{

 

public function process()

{

parent::process();

self::$smarty->assign('shopaddress',Configuration::get('PS_SHOP_ADDR1'));

self::$smarty->assign('shopphone',Configuration::get('PS_SHOP_PHONE'));

self::$smarty->assign('shopemail',Configuration::get('PS_SHOP_EMAIL'));

self::$smarty->assign('shopfax',Configuration::get('PS_SHOP_FAX'));

 

 

}

}

?>

 

then you can use the smarty variables inside the tpl files, for example in the contact-form.tpl:

 

 

<p>{l s='Phone'}: {$shopphone}</p>

Link to comment
Share on other sites

Hello,

 

I used all the solutions but no chance to work. I use 1.4.6.2 and i have 1 theme installed. I couldn't make the codes work. cosmicfrog, i also tried your solution but no work. Can you just upload fies please? Maybe i missed sth.

 

TIA

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

this is the reason prestashop is not heading well, Even the small problem will have to wait a Year to be solved. I don't know why these days Open source are converting to Source Of Money. They are more focused on their own commercial add ons.

this is the reason prestashop is not heading well, Even the small problem will have to wait a Year to be solved. I don't know why these days Open source are converting to Source Of Money. They are more focused on their own commercial add ons.

 

You are right all other open source carts provide these information on contact us page but PS not added yet.

Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...

I have version 1..4.4.1 loaded. After some fiddling around with the code .... that didn't work for me, I did this:

 

I went to Themes > Prestashop > contact-form.tpl and opened it to edit

 

I copied the line (about line 16 - I don't have numbers in the side margin of my ftp client) :

 

<p class="bold">{l s='For questions about an order or for more information about our products'}.</p>

 

And I pasted it directly underneath. I added some more text and my mobile number at the end of the first line (above) and then, as my site is in French and English, I rewrote the second (pasted) line in French.

 

Uploaded it back to the erver, cleared the cache and voilà - job done !

 

You can see how it looks by going to www.selleriestpierre.com and clicking on the Contact icon at the top.

 

Hope this helps someone.

Edited by marronne (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...