bonbontamura Posted June 15, 2011 Share Posted June 15, 2011 Hallo,maybe anyone can help me, or we can work together if someone is interested.the target is:I want to show the opening hours in stores.php page OUTSIDE the map. Of course I can type it manually in my stores.tpl but it would be hard for my employee if she has to edit it . so the page stores.php should read the opening hours from the database.What I did now (See pictures):1. fill in the opening hours in shops tab2. edit my stores.tpl file and insert this line somewhere: {$store.hours|escape:'htmlall':'UTF-8'} The output wasn't as I expected. It showed the hours but it didn't serialized the days (see pictures)What did I do wrong? can someone help me please?thanks in advanced! Link to comment Share on other sites More sharing options...
Deena Jack Posted November 10, 2011 Share Posted November 10, 2011 Hi, we have the same problem let we find the solution for these.... have a good day.. regards, K.Deena Jack Link to comment Share on other sites More sharing options...
Deena Jack Posted November 10, 2011 Share Posted November 10, 2011 I've changed stored.tpl but it doesn't show opening hours in my home page Need assistance....... Thanks in advance. Link to comment Share on other sites More sharing options...
Pit Group Intech B.V. Posted December 4, 2012 Share Posted December 4, 2012 (edited) FIND foreach ($stores AS &$store) $store['has_picture'] = file_exists(_PS_STORE_IMG_DIR_.(int)($store['id_store']).'.jpg'); //foreach ($stores AS &$store) //$store['has_picture'] = file_exists(_PS_STORE_IMG_DIR_.(int)($store['id_store']).'.jpg'); $days[1] = 'Monday'; $days[2] = 'Tuesday'; $days[3] = 'Wednesday'; $days[4] = 'Thursday'; $days[5] = 'Friday'; $days[6] = 'Saturday'; $days[7] = 'Sunday'; foreach ($stores as &$store) { $store['has_picture'] = file_exists(_PS_STORE_IMG_DIR_.(int)($store['id_store']).'.jpg'); $days_datas = array(); $other = ''; if (!empty($store['hours'])) { $hours = unserialize($store['hours']); for ($i = 1; $i < 8; $i++) { $hours_datas = array(); $hours_datas['day'] = $days[$i]; $hours_datas['hours'] = $hours[(int)($i) - 1]; $days_datas[] = $hours_datas; } $store['days_datas'] = $days_datas; } } PLACE IN FOREACH IN TEMPLATE STORES.TPL <p><strong>{l s='Hours:'}</strong></p> <ul class="hours">{foreach from=$store.days_datas item=one_day} <li><span>{l s=$one_day.day}</span>{$one_day.hours}</li> {/foreach}</ul> Edited December 6, 2012 by Pit Group Intech B.V. (see edit history) 1 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