default text if no specials available
Apologies if this has already been covered somewhere. I could not find it by doing a search and it would have taken me hours to read through all 26 pages of threads in this forum topic.
I have no specials set up and don't intend to offer specials other than occasionally. Right now the specials page is just a blank page but I'd like to have at least some kind of notice that says something "There are currently no specials being offered." I'm hoping there is already a mechanism that I'm just overlooking to do this rather than hacking the specials page code.
Any tips (or links to where this might be on the forum already) are much appreciated.
Thanks!
Re: default text if no specials available
Quote:
Originally Posted by
earmsby
Apologies if this has already been covered somewhere. I could not find it by doing a search and it would have taken me hours to read through all 26 pages of threads in this forum topic.
I have no specials set up and don't intend to offer specials other than occasionally. Right now the specials page is just a blank page but I'd like to have at least some kind of notice that says something "There are currently no specials being offered." I'm hoping there is already a mechanism that I'm just overlooking to do this rather than hacking the specials page code.
Any tips (or links to where this might be on the forum already) are much appreciated.
Thanks!
Not sure of where specifically it would be, but seems like there are actually two routes one could take. Disable the specials area when there are no specials or as you have requested to present alternate text when there are none.
To be clear though, you are wanting to address the condition where the uri looks something like: index.php?main_page=specials and there are no specials currently available, correct? Not other areas where specials appear?
Re: default text if no specials available
Quote:
Originally Posted by
mc12345678
To be clear though, you are wanting to address the condition where the uri looks something like: index.php?main_page=specials and there are no specials currently available, correct? Not other areas where specials appear?
Yes, the uri is exactly as you've shown. I think for now I will just deactivate the EZ page I used to add it to the header EZ-Page menu. Then, there won't be any visible link to it. If I want to run a special, I can just re-activate the EZ-Page.
Re: default text if no specials available
Quote:
Originally Posted by
earmsby
Yes, the uri is exactly as you've shown. I think for now I will just deactivate the EZ page I used to add it to the header EZ-Page menu. Then, there won't be any visible link to it. If I want to run a special, I can just re-activate the EZ-Page.
Well, if you did want to have the specials page appear, but to show some amount of text then it looks like the following would support that:
edit includes/modules/pages/specials/main_template_vars.php
find:
Code:
}
require($template->get_template_dir('tpl_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_specials_default.php');
}
}
and modify to:
Code:
}
require($template->get_template_dir('tpl_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_specials_default.php');
} else {
require($template->get_template_dir('tpl_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_specials_default.php');
}
}
Then in includes/templates/YOUR_TEMPLATE/templates either edit tpl_specials_default.php or copy the file of the same name from includes/templates/template_default/templates into the YOUR_TEMPLATE path.
In includes/templates/YOUR_TEMPLATE/templates/tpl_specials_default.php
find:
Code:
/**
* require the list_box_content template to display the products
*/
require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
Modify so that this will be "replaced" by the content to be presented. Now the replacement content could be hard coded text (discouraged), it could be the display of a defined variable (preferably one within the language file path), or some form of file such as a defined page (if a defined page that is to be related to your current template then the page needs to exist in both the base directory [such as includes/languages/YOUR_LANGUAGE/html_includes] and in the template override[includes/languages/YOUR_LANGUAGE/html_includes/YOUR_TEMPLATE].) To include a define then it would be changed to:
Code:
if ($num_products_count) {
/**
* require the list_box_content template to display the products
*/
require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
} else {
echo TEXT_SPECIALS_NO_PRODUCTS_EXIST;
}
This is untested, but appears like it may work... Remember objects in mirror may be closer than they appear...