Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    May 2009
    Posts
    413
    Plugin Contributions
    0

    Default Disable Categories Tabs Menu On Checkout Pages

    Hi,

    Is there a way of disabling the categories tabs menu during checkout?

    I'm already disabling the sidebars via the $flag_disable_right = true; and $flag_disable_left = true; settings in /common/tpl_main_page.php - could I use a similar method to disable the categories tabs menu during checkout too?

    Thanks

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    Yes, you can.
    You need to add an if() test around the line that calls the categories-tabs file, in /includes/templates/your_template/common/tpl_header.php.
    Alter that section to look like this:
    PHP Code:
    <!--bof-optional categories tabs navigation display-->
    <?php if (strpos($current_page_base'checkout') !== 0) { 
      require(
    $template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); 
    ?>
    <!--eof-optional categories tabs navigation display-->
    if (strpos($current_page_base, 'checkout') !== 0) {
    says"if the current page name does not start with checkout, do this".

    You could do a similar thing in tpl_modules_categories_tabs.php instead, if you wanted.

  3. #3
    Join Date
    May 2009
    Posts
    413
    Plugin Contributions
    0

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    Hi Glenn,

    I really appreciate the reply

    I'm using a purchased template - the bit of code within tpl_header.php that calls the (customized) categories-tabs file (aka categories_css.php, I think) looks like it already has an if statement around it:

    PHP Code:
    <!--bof-optional categories tabs navigation display-->
    <?php
     
    if (CATEGORIES_TABS_STATUS == '1') {
         require(
    DIR_WS_MODULES zen_get_module_directory('categories_css.php'));
     } 
    ?>
    <!--eof-optional categories tabs navigation display-->
    Can I still apply your suggested method to that^ bit of code?

    Thanks

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    Yes, you would add my test to the existing test, like this:
    PHP Code:
     if ((CATEGORIES_TABS_STATUS == '1') and (strpos($current_page_base'checkout') !== 0)) { 

  5. #5
    Join Date
    May 2009
    Posts
    413
    Plugin Contributions
    0

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    Perfect! ...almost one last thing - could I set which pages do and don't display the tabs menu via an "array" like the one I use to disable sidebars? Rather than the "if the current page name starts with checkout" method? Reason being that I have some checkout pages that don't start with "checkout" for instance a "no_account" page added by Numinix's FEC module.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    You could certainly do that instead. You didn't mention that you had anything different from stock checkout.

  7. #7
    Join Date
    May 2009
    Posts
    413
    Plugin Contributions
    0

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    Okay, almost there! ...my current bit of code looks like this:

    PHP Code:
    <!--bof-optional categories tabs navigation display-->
    <?php
     
    if ((CATEGORIES_TABS_STATUS == '1') and (strpos($current_page_base'checkout') !== 0)) {
         require(
    DIR_WS_MODULES zen_get_module_directory('categories_css.php'));
     } 
    ?>
    <!--eof-optional categories tabs navigation display-->
    How would I edit the above to use an "array" rather than the "if page is checkout" method?

    Thanks for the help so far

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    Replace
    PHP Code:
    (strpos($current_page_base'checkout') !== 0
    with
    PHP Code:
    (in_array($current_page_baseexplode(',''checkout_page_one,checkout_page_two,no_account,etc'))) 
    substituting your actual page names.

  9. #9
    Join Date
    May 2009
    Posts
    413
    Plugin Contributions
    0

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    Uhm... that's a bit weird - now the tabs are only showing on the pages listed within the array, and not on any other pages. I intended for it to be the complete opposite! As in, show the tabs on all pages apart from the ones listed in the array. I must of done something wrong

    Here's my current code:

    PHP Code:
    <!--bof-optional categories tabs navigation display-->
    <?php
     
    if ((CATEGORIES_TABS_STATUS == '1') and (in_array($current_page_baseexplode(',''pages_to,disable_tabs,here')))) {
         require(
    DIR_WS_MODULES zen_get_module_directory('categories_css.php'));
     } 
    ?>
    <!--eof-optional categories tabs navigation display-->

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Disable Categories Tabs Menu On Checkout Pages

    Oops, I forgot to translate the "not" part when converting between methods...

    and (in_array($current_page_base,

    needs to be

    and (!in_array($current_page_base,

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Categories - Tabs Menu - SubCat
    By lindasdd in forum Customization from the Admin
    Replies: 0
    Last Post: 22 Nov 2009, 09:48 PM
  2. Categories-Tabs Menu
    By PGlad in forum Customization from the Admin
    Replies: 2
    Last Post: 27 Jun 2007, 04:01 PM
  3. Categories-Tabs Menu
    By GouldRoss in forum General Questions
    Replies: 3
    Last Post: 10 Apr 2007, 08:10 AM
  4. Categories Tabs menu issue
    By duxfield in forum Basic Configuration
    Replies: 4
    Last Post: 15 Jan 2007, 12:05 AM
  5. Categories-Tabs Menu Issue
    By duxfield in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Jan 2007, 10:21 AM

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