mmony Posted October 8, 2012 Share Posted October 8, 2012 Hi, I'm trying to include the email address field and the "notes" field from the Store Locator in the map display - specifically I'd like them to appear in the table under the map where the search results are displayed. I've dug around endlessly, but can't figure out how to add them to the template in 1.5. Any thoughts would be greatly appreciated. Link to comment Share on other sites More sharing options...
Toeareg Posted January 4, 2013 Share Posted January 4, 2013 I have been trying the same thing but I couldn't find it in any of the possible B.O. settings options. I then turned to the source code and it turned out that the fax, email and note fields are simply ignored in the template. At least in the simplified view that I am using. So if you use the simplified view, you can edit the stores.tpl file which is located in the themes folder for your theme. Here's what I did: {if $store.phone}{l s='Phone:' js=0} {$store.phone}<br />{/if} {if $store.fax}{l s='Fax:' js=0} {$store.fax}<br />{/if} {if $store.email}{l s='Email:' js=0} {$store.email}<br />{/if} </p> {if isset($store.working_hours)}{$store.working_hours}{/if}<br /> {if $store.note}{l s='' js=0}<br /> {$store.note}{/if} {* Note displayed without title and <br /> inserted to create distance *} As you can see, I display the note field below the opening hours because it contains extra information about these opening hours. FYI, I am using PS 1.5.2 and the code you are looking for (the phone field) is at line 45 in stores.tpl. Hope this helps. Link to comment Share on other sites More sharing options...
sgtbash Posted January 8, 2013 Share Posted January 8, 2013 Hey, I'm looking to do exactly the same although in the little pop up inside the map when you click on a store. I've found how to add text into that box (store_info.tpl) although do not know the variable to get the phone number, email or notes to come up? I'm on PS 1.4.9 Thanks Dan Link to comment Share on other sites More sharing options...
Toeareg Posted January 8, 2013 Share Posted January 8, 2013 Sorry, can't help you with that. I'm not using the map display. Link to comment Share on other sites More sharing options...
sgtbash Posted January 8, 2013 Share Posted January 8, 2013 (edited) Hmm, found a solution - how useful it is I am not sure as it involves a core mod. In StoresController.php, Approx Line 122 place: if (!empty($store['phone'])){ $smarty->assign('stores_telephone', $store['phone']); } if (!empty($store['email'])){ $smarty->assign('stores_email', $store['email']); } Then in stores_info.tpl, wherever you want to place the info: <span id="store_phone">{l s='Phone:'}</span> {$stores_telephone}<br /> <span id="store_email">{l s='Email:'}</span> <a href='mailto:{$stores_email}?Subject=Put Subject Here'>{$stores_email}</a><br /> If you've got a better solution for this, without using a core mod - please let me know =) Thanks Dan Edited January 8, 2013 by sgtbash (see edit history) Link to comment Share on other sites More sharing options...
framarfre Posted May 1, 2015 Share Posted May 1, 2015 Hi, I'm on PrestaShop 1.6.0.14 and I can not show notes and email. It seems to me correct, where wrong? This is my stores.tpl please help me to find a solution {* * 2007-2014 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright 2007-2014 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} {capture name=path}{l s='Our stores'}{/capture} <h1 class="page-heading"> {l s='Our stores'} </h1> {if $simplifiedStoresDiplay} {if $stores|@count} <p class="store-title"> <strong class="dark"> {l s='Here you can find our store locations. Please feel free to contact us:'} </strong> </p> <table class="table table-bordered"> <thead> <tr> <th class="logo">{l s='Logo'}</th> <th class="name">{l s='Store name'}</th> <th class="address">{l s='Store address'}</th> <th class="store-hours">{l s='Working hours'}</th> </tr> </thead> {foreach $stores as $store} <tr class="store-small"> <td class="logo"> {if $store.has_picture} <div class="store-image"> <img src="{$img_store_dir}{$store.id_store}-medium_default.jpg" alt="{$store.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}"/> </div> {/if} </td> <td class="name"> {$store.name|escape:'html':'UTF-8'} </td> <td class="address"> {assign value=$store.id_store var="id_store"} {foreach from=$addresses_formated.$id_store.ordered name=adr_loop item=pattern} {assign var=addressKey value=" "|explode:$pattern} {foreach from=$addressKey item=key name="word_loop"} <span {if isset($addresses_style[$key])} class="{$addresses_style[$key]}"{/if}> {$addresses_formated.$id_store.formated[$key|replace:',':'']|escape:'html':'UTF-8'} </span> {/foreach} {/foreach} <br/> {if $store.phone}<br/>{l s='Phone:'} {$store.phone|escape:'html':'UTF-8'}{/if} {if $store.fax}<br/>{l s='Fax:'} {$store.fax|escape:'html':'UTF-8'}{/if} {if $store.email}<br/>{l s='Email:'} {$store.email|escape:'html':'UTF-8'}{/if} {if $store.note}<br/><br/>{$store.note|escape:'html':'UTF-8'|nl2br}{/if} </td> <td class="store-hours"> {if isset($store.working_hours)}{$store.working_hours}{/if} </td> </tr> {/foreach} </table> {/if} {else} <div id="map"></div> <p class="store-title"> <strong class="dark"> {l s='Enter a location (e.g. zip/postal code, address, city or country) in order to find the nearest stores.'} </strong> </p> <div class="store-content"> <div class="address-input"> <label for="addressInput">{l s='Your location:'}</label> <input class="form-control" type="text" name="location" id="addressInput" value="{l s='Address, zip / postal code, city, state or country'}" /> </div> <div class="radius-input"> <label for="radiusSelect">{l s='Radius:'}</label> <select name="radius" id="radiusSelect" class="form-control"> <option value="1500">1500 km</option> <option value="20037">20037 km</option> </select> <img src="{$img_ps_dir}loader.gif" class="middle" alt="" id="stores_loader" /> </div> <div> <button name="search_locations" class="button btn btn-default button-small"> <span> {l s='Search'}<i class="icon-chevron-right right"></i> </span> </button> </div> </div> <div class="store-content-select selector3"> <select id="locationSelect" class="form-control"> <option>-</option> </select> </div> <table id="stores-table" class="table table-bordered"> <thead> <tr> <th class="num">#</th> <th>{l s='Store'}</th> <th>{l s='Address'}</th> <th>{l s='Distance'}</th> </tr> </thead> <tbody> </tbody> </table> {strip} {addJsDef map=''} {addJsDef markers=array()} {addJsDef infoWindow=''} {addJsDef locationSelect=''} {addJsDef defaultLat=$defaultLat} {addJsDef defaultLong=$defaultLong} {addJsDef hasStoreIcon=$hasStoreIcon} {addJsDef distance_unit=$distance_unit} {addJsDef img_store_dir=$img_store_dir} {addJsDef img_ps_dir=$img_ps_dir} {addJsDef searchUrl=$searchUrl} {addJsDef logo_store=$logo_store} {addJsDefL name=translation_1}{l s='No stores were found. Please try selecting a wider radius.' js=1}{/addJsDefL} {addJsDefL name=translation_2}{l s='store found -- see details:' js=1}{/addJsDefL} {addJsDefL name=translation_3}{l s='stores found -- view all results:' js=1}{/addJsDefL} {addJsDefL name=translation_4}{l s='Phone:' js=1}{/addJsDefL} {addJsDefL name=translation_5}{l s='Get directions' js=1}{/addJsDefL} {addJsDefL name=translation_6}{l s='Not found' js=1}{/addJsDefL} {/strip} {/if} Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now