Jump to content

How to add Store Hours of operation in simplified version of Store module ?


Recommended Posts

Hello

I've searche the forumm for hours an then worked on a few .tpl files and can not get my store hours of operation to list in simpified version of store module.

 

I would like to add the store hours in the simplified version of the store module in prestashop 1.4.8.3

 

how can i do this . i tried playing with the templates in my theme files and can not get the hours to be placed after the store address and phone number .

 

i ve tried using {include file="$tpl_dir./store_infos.tpl"} statement in the stores.tpl after <b>{if $store.phone}{l s='Phone:' js=0}</b> {$store.phone}{/if}<br>

 

 

but only get the 1 line that says hours and not the full listing of days and hours as it does in the popup when module not used in simplified version.

 

can anyone help. ? what am i missing , are there other files to change ????

 

Thank You in advance for any help

Link to comment
Share on other sites

okay, i figured out how to show the times with this code

    {assign var="unserialized_data" value=$store.hours|unserialize}
	 {foreach $unserialized_data as $raw}
	    {$raw} <br />
	  {/foreach}

(just add to stores.tpl)

 

now i don't know how to add the days names..any ideas?

Link to comment
Share on other sites

    {assign var=daynames value=[Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag]}
    {assign var="count" value=0}
    {assign var="unserialized_data" value=$store.hours|unserialize}
	 {foreach $unserialized_data as $raw}
		 {$daynames[$count]}: {$raw} <br />
		 {$count = $count +1}
	  {/foreach}

 

Hope this Helps, didnt know how to integrate the translation, but for me it works.

Just add css classes or html to adapt it to your layout.

 

if anyone knows a better solution, i'd love to see it :-)

Link to comment
Share on other sites

For those that might be interested, here is what I ended up with after reading this so I thought I would share.

 

Add this to the bottom of stores.tpl located in ..themes/yourtheme/ after the final closing </if> statement :.

I have mine on the right to the right side of the store address so you will need to change the float and margin to your needs.

 

<div id="StoreHours">{l s='Working Hours'}</div>

<div id="StoreHours1"> {assign var=daynames value=[Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday]}

{assign var="count" value=0}

{assign var="unserialized_data" value=$store.hours|unserialize}

{foreach $unserialized_data as $raw}

{$daynames[$count]}: {$raw} <br />

{$count = $count +1}

{/foreach}</div>

 

Now add this to the stores.css file located in themes/yourtheme/css:

 

#StoreHours {

font-weight: bold;

text-decoration: underline;

width: 120px;

height: 15px;

display: block;

float:right;

margin: -100px 120px 0 0

}

 

#StoreHours1 {

font-weight: normal;

text-decoration: none;

width: 200px;

height: 200px;

display: block;

float:right;

margin: -80px 40px 0 0

}

 

Here is a pic of how it looks:

 

Edited by tdr170 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...