Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2006
    Location
    Worcester, MA
    Posts
    453
    Plugin Contributions
    0

    Default 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!
    Ellie Armsby

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: default text if no specials available

    Quote Originally Posted by earmsby View Post
    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?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Oct 2006
    Location
    Worcester, MA
    Posts
    453
    Plugin Contributions
    0

    Default Re: default text if no specials available

    Quote Originally Posted by mc12345678 View Post

    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.
    Ellie Armsby

  4. #4
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: default text if no specials available

    Quote Originally Posted by earmsby View Post
    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...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v154 Admin Specials Code Snippet - Show Yellow Icon for Future Available Dates
    By kwright in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 31 Aug 2016, 07:18 PM
  2. Cannot disable specials with an available date (1.3.9h)
    By Alex Clarke in forum Bug Reports
    Replies: 1
    Last Post: 8 Jul 2011, 03:03 PM
  3. Default Specials Page
    By Website Rob in forum Templates, Stylesheets, Page Layout
    Replies: 21
    Last Post: 19 May 2011, 05:40 PM
  4. Unit Price available by Default?
    By ebaobao in forum General Questions
    Replies: 3
    Last Post: 18 Oct 2009, 08:54 PM
  5. Specials Available and Expiry Dates
    By janice3169 in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 5 Sep 2009, 05:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR