Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Disable Categories Tabs Menu On Checkout Pages

Disable Categories Tabs Menu On Checkout Pages

Views: 1,066

Results 1 to 11 of 11
20 Dec 2012, 4:10 PM
#1
gaffettape avatar

gaffettape

Zen Follower

Join Date:
May 2009
Posts:
433
Plugin Contributions:
0

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 :smile:

20 Dec 2012, 4:56 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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

<!--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-->
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.
20 Dec 2012, 5:30 PM
#3
gaffettape avatar

gaffettape

Zen Follower

Join Date:
May 2009
Posts:
433
Plugin Contributions:
0

Re: Disable Categories Tabs Menu On Checkout Pages

Hi Glenn,

I really appreciate the reply :smile:

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:

<!--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 :smile:

20 Dec 2012, 5:52 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Disable Categories Tabs Menu On Checkout Pages

Yes, you would add my test to the existing test, like this:

 if ((CATEGORIES_TABS_STATUS == '1') and (strpos($current_page_base, 'checkout') !== 0)) {
20 Dec 2012, 6:12 PM
#5
gaffettape avatar

gaffettape

Zen Follower

Join Date:
May 2009
Posts:
433
Plugin Contributions:
0

Re: Disable Categories Tabs Menu On Checkout Pages

Perfect! ...almost:blush: 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.

20 Dec 2012, 6:25 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

20 Dec 2012, 6:37 PM
#7
gaffettape avatar

gaffettape

Zen Follower

Join Date:
May 2009
Posts:
433
Plugin Contributions:
0

Re: Disable Categories Tabs Menu On Checkout Pages

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

<!--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 :smile:

20 Dec 2012, 6:54 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Disable Categories Tabs Menu On Checkout Pages

Replace```php
(strpos($current_page_base, 'checkout') !== 0)

with```php
(in_array($current_page_base, explode(',', 'checkout_page_one,checkout_page_two,no_account,etc')))
``` substituting your actual page names.
20 Dec 2012, 7:09 PM
#9
gaffettape avatar

gaffettape

Zen Follower

Join Date:
May 2009
Posts:
433
Plugin Contributions:
0

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 :mellow:

Here's my current code:

<!--bof-optional categories tabs navigation display-->
<?php
 if ((CATEGORIES_TABS_STATUS == '1') and (in_array($current_page_base, explode(',', 'pages_to,disable_tabs,here')))) {
     require(DIR_WS_MODULES . zen_get_module_directory('categories_css.php'));
 } ?>
<!--eof-optional categories tabs navigation display-->
21 Dec 2012, 12:43 AM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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,

21 Dec 2012, 12:59 AM
#11
gaffettape avatar

gaffettape

Zen Follower

Join Date:
May 2009
Posts:
433
Plugin Contributions:
0

Re: Disable Categories Tabs Menu On Checkout Pages

Perfect!

Here's the final code (it seems to be working as planned, I hope it's correct):

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

Thanks Glenn, I really appreciate your help :smile: