Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

Locked

Views: 2,478

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
17 Oct 2008, 9:50 PM
#1
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

Can someone shed some light here for me.
I have done everything according to the following threads

http://www.zen-cart.com/forum/showthread.php?t=63813

http://www.zen-cart.com/forum/showthread.php?t=58030

And especially this one http://www.zen-cart.com/forum/showpost.php?p=327394&postcount=3

but

All failed. Here is what I have in the files I need this working on

First file includes/modules/column_left.php

// safety row stop
$box_cnt=0;
while (!$column_left_display->EOF and $box_cnt < 100) { 
  if (in_array($current_page_base,explode(",",'login,checkout_shipping,checkout_payment,checkout_confirmation')) && in_array($column_left_display->fields['layout_box_name'],explode(",",'search_header.php,categories.php,manufacturers.php,whats_new.php,featured.php,specials.php,currencies.php,aweber_sidebox')) ) { 
    // don't show anything 
    echo 'base ' . $current_page_base . ' vs ' . $column_left_display->fields['layout_box_name'] . '<br>'; 
  } else { 
  $box_cnt++;  
  
 if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $column_left_display->fields['layout_box_name']) or file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $column_left_display->fields['layout_box_name']) ) {
?>
<?php

//$column_box_spacer = 'column_box_spacer_left';
$column_width = BOX_WIDTH_LEFT;
if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $column_left_display->fields['layout_box_name']) ) {
  $box_id = zen_get_box_id($column_left_display->fields['layout_box_name']);
  require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $column_left_display->fields['layout_box_name']);
} else {
  $box_id = zen_get_box_id($column_left_display->fields['layout_box_name']);
  require(DIR_WS_MODULES . 'sideboxes/' . $column_left_display->fields['layout_box_name']);
}

  } // file_exists
   } // skip sidebox on pages 
  $column_left_display->MoveNext();

Did not work

Next file

includes/templates/MY_TEMPLATE/common/tpl_main_page.php

 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_main_page.php 7085 2007-09-22 04:56:31Z ajeh $
 */

// the following IF statement can be duplicated/modified as needed to set additional flags
  if (in_array($current_page_base,explode(",",'login,product_info,product_music_info,document_general_info,product_free_shipping_info,document_product_info,aweber_sidebox,checkout_shipping,checkout_payment,checkout_confirmation'')) ) {
    $flag_disable_right = true;
  }

Is there something different in 1.3.8a that stops this from working?

We have placed them in the override folders and replaced the original files as well both failed.

Maybe someone has experienced this and can help shine some magic on it to make it work.

We want the left colum not to display during checkout better yet just one sidebox would work which is aweber but it failed to do so the left side will work for us if we can get it to do what we want it to do.

Thanks in advance

17 Oct 2008, 10:16 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

The approach documented in the thread that you have highlighted works fine when implemented properly. Your code doesn't quite match it. For example you have uncommented the line that starts "echo 'base ' ".

Your code for the second approach is more accurate, but you have set the flag that disables the right column, rather than the left column, which you are targeting.

17 Oct 2008, 10:59 PM
#3
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

kuroi

Thats only part of the code if you look in the includes/templates/MY_TEMPLATE/common/tpl_main_page.php it has four files set as true left, right center and so on.

None of those worked either this has been a 3 day project and failed it is the reason I posted. :(

17 Oct 2008, 11:01 PM
#4
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

I have attached the exact files i have if you want to look at them

17 Oct 2008, 11:37 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

The code in your tpl_main_page.php template will disable the right column for the login and all product info pages. The reference to the aweber sidebox will be ignored since that's not a page.

The code in your column_left.php template disables the specific sideboxes mentioned, i.e. search header, categories, manufacturers, currencies and the product sideboxes from the login and checkout pages. Again the aweber sidebox referecne will be ignored, though this time because it's incomplete (missing ".php" on the end).

However, both of these outcomes seem to be close to opposite of that which you say you're trying to achieve, so I'm confused as to your objectives.

17 Oct 2008, 11:53 PM
#6
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

The aweber sidebox causes ssl errors when loaded in ssl pages we just want this one side box not to load on any ssl required pages such as login, checkout etc.

If we have to disable the complete column for these pages is fine we just cannot get it to work.

The aweber java form is not ssl secured and thats causing the unsecured warning error.

17 Oct 2008, 11:56 PM
#7
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

Here is one of the pages erroring if you like to see it

18 Oct 2008, 12:12 AM
#8
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

You don't need to disable the whole column. You can disable individual boxes, as explained in this FAQ.

The differences for you situation are that you would edit the aweber module file and use the following IF condition> if ($request_type == 'SSL')though this does pre-suppose that the aweber sidebox module follows the normal Zen Cart conventions.

19 Oct 2008, 12:21 AM
#9
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

This file is from includes/modules/sideboxes

Do I add the if with the current if or under it or before?

Original

  $show_aweber_sidebox = true;

  if ($show_aweber_sidebox == true) {
      require($template->get_template_dir('tpl_aweber_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_aweber_sidebox.php');
      $title =  BOX_HEADING_AWEBER_SIDEBOX;
      $left_corner = false;
      $right_corner = false;
      $right_arrow = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>

Possible replacement

  $show_aweber_sidebox = true;
  if ($show_aweber_sidebox == true) 
  if ($request_type == 'SSL') {
      require($template->get_template_dir('tpl_aweber_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_aweber_sidebox.php');
      $title =  BOX_HEADING_AWEBER_SIDEBOX;
      $left_corner = false;
      $right_corner = false;
      $right_arrow = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>
19 Oct 2008, 9:20 AM
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

if ($request_type == 'SSL') $show_aweber_sidebox = true;

if ($show_aweber_sidebox == true) { 
  require($template->get_template_dir('tpl_aweber_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_aweber_sidebox.php');
      $title =  BOX_HEADING_AWEBER_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>

It's slightly more code than is strictly needed, but makes clear what's going on.

19 Oct 2008, 1:06 PM
#11
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

kuroi,

Seems it would be but I guess it was not strict enough.

Any other ideas what maybe causing this sidebox to show and ignoring the code?

We have placed it in the override folder and the default folder and still ignores it.

Here is what I have in the includes/modules/shop_red/column_left.php.

I also tried the column_left.php with the default file that comes with zencart it failed to.

I also removed the form script from the mod within the admin and tried it and it still errors so the form is out of the question it is defintely in the mod files somewhere.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=483 download page

// safety row stop
$box_cnt=0;
while (!$column_left_display->EOF and $box_cnt < 100) { 
  if (in_array($current_page_base,explode(",",'login,checkout_shipping,checkout_payment,checkout_confirmation')) && in_array($column_left_display->fields['layout_box_name'],explode(",",'aweber_sidebox.php')) ) { 
    // don't show anything 
    echo 'base ' . $current_page_base . ' vs ' . $column_left_display->fields['layout_box_name'] . '<br>'; 
  } else { 
  $box_cnt++;  
  
 if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $column_left_display->fields['layout_box_name']) or file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $column_left_display->fields['layout_box_name']) ) {
?>

Totally removed aweb_sidebox out of the tpl_main_page.php

Added this to the includes/sideboxes/shop_red/aweber_sidebox.php

// test if box should display
  $show_aweber_sidebox = true;

if ($request_type == 'SSL') $show_aweber_sidebox = true;

if ($show_aweber_sidebox == true) { 
  require($template->get_template_dir('tpl_aweber_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_aweber_sidebox.php');
      $title =  BOX_HEADING_AWEBER_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>

Am I missing something here or this just not working and the code is being ignored?
Appreciate all the help and time you are giving

19 Oct 2008, 1:15 PM
#12
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

Guess morning coffee did not kick in the brain fast enough

Changed

if  ($request_type == 'SSL') $show_aweber_sidebox = true; 

to

if ($request_type == 'SSL') $show_aweber_sidebox = false;

Guess was the missing key

Again appreciate your help

19 Oct 2008, 1:19 PM
#13
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

That's the one. Your coffee is obviously stronger than mine :thumbsup:.

19 Oct 2008, 1:23 PM
#14
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Turn Off Sidebox In 1.3.8a during checkout pages Tried A - Z Failed

Appreciate the help trust me this was getting under the skin :wacko: