Zen Cart Logo

Blank Page.. Help!

Views: 1,767

Results 1 to 17 of 17
25 Jun 2011, 10:00 PM
#1
boatersplanet avatar

boatersplanet

New Zenner

Join Date:
Aug 2010
Location:
Washington, DC
Posts:
66
Plugin Contributions:
0

Blank Page.. Help!

I recently installed a new template and performed a clean install of 1.3.9h. Everything worked fine before, but with the new template, I am experiencing a blank page at checkout AND in the admin when clicking on the shipping module. I have checked the debug and it keeps giving me error codes such as:

[25-Jun-2011 17:57:05] PHP Fatal error:  Cannot redeclare class item in /home/user/public_html/includes/modules/shipping/item.php on line 11

I have had a number of these errors associated with the different shipping pages and after searching the forum and trying suggested fixes, none are working.

Can someone please help?!

26 Jun 2011, 4:51 AM
#2
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Blank Page.. Help!

Please note that i have no idea what i am talking about, BUT,

Are you using the stock shipping module or are you trying to clone it for another function?

26 Jun 2011, 1:57 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Blank Page.. Help!

Could you look and see if you have a duplicate or backup copy of:
/includes/modules/shipping/item.php

Or, check the language file:
/includes/languages/english/modules/shipping/item.php

and make sure that is the language file and not the code file ...

26 Jun 2011, 3:30 PM
#4
boatersplanet avatar

boatersplanet

New Zenner

Join Date:
Aug 2010
Location:
Washington, DC
Posts:
66
Plugin Contributions:
0

Re: Blank Page.. Help!

Ajeh:

Could you look and see if you have a duplicate or backup copy of:
/includes/modules/shipping/item.php

Or, check the language file:
/includes/languages/english/modules/shipping/item.php

and make sure that is the language file and not the code file ...

No Duplicate copy... what should i look for in the english directory?

26 Jun 2011, 3:51 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Blank Page.. Help!

Go to your Tools ... Developers Tool Kit ...

in the bottom input box enter:
class item

select Catalog ... and click SEARCH ...

What files come up for this?

26 Jun 2011, 3:55 PM
#6
boatersplanet avatar

boatersplanet

New Zenner

Join Date:
Aug 2010
Location:
Washington, DC
Posts:
66
Plugin Contributions:
0

Re: Blank Page.. Help!

/home/user/public_html/includes/languages/english/modules/shipping/item.php

Line #10 : class item {
 
/home/user/public_html/includes/modules/shipping/item.php

Line #10 : class item { 

this is what I found...

26 Jun 2011, 4:02 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Blank Page.. Help!

This line:

/home/user/public_html/includes/languages/english/modules/shipping/item.php

indicates that you have the item.php code file copied in the language directory ...

Check the original files and you want to load the language file for the:
/home/user/public_html/includes/languages/english/modules/shipping/item.php

this is the one with all of the define statements in it ...

26 Jun 2011, 8:06 PM
#8
boatersplanet avatar

boatersplanet

New Zenner

Join Date:
Aug 2010
Location:
Washington, DC
Posts:
66
Plugin Contributions:
0

Re: Blank Page.. Help!

I have... and I still get the error

[26-Jun-2011 16:04:54] PHP Fatal error:  Cannot redeclare class item in /home/USER/public_html/includes/modules/shipping/item.php on line 11
26 Jun 2011, 8:13 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Blank Page.. Help!

Go back and re-read what Ajeh posted, and follow her instructions.

You've got a class file loaded in your language folder. The file in the language folder needs to contain defines, not classes. Reload the original files.

26 Jun 2011, 8:18 PM
#10
boatersplanet avatar

boatersplanet

New Zenner

Join Date:
Aug 2010
Location:
Washington, DC
Posts:
66
Plugin Contributions:
0

Re: Blank Page.. Help!

Dr. Byte-

I have downloaded a clean copy from the website and uploaded the contents of /languages/english/modules/

I am still getting this error... I don't know if it's related to my new template (ABlueGrill) or if it is something else.. :frusty:

26 Jun 2011, 9:07 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Blank Page.. Help!

Redo the search Ajeh recommended in post 5. What are the results now?

26 Jun 2011, 9:30 PM
#12
boatersplanet avatar

boatersplanet

New Zenner

Join Date:
Aug 2010
Location:
Washington, DC
Posts:
66
Plugin Contributions:
0

Re: Blank Page.. Help!

DrByte:

Redo the search Ajeh recommended in post 5. What are the results now?

/home/USER/public_html/includes/languages/english/modules/shipping/item.php

Line #10 : class item { 
26 Jun 2011, 9:45 PM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Blank Page.. Help!

You have the same error so probably the same problem ...

/home/USER/public_html/includes/languages/english/modules/shipping/item.php

The language file for item.php looks like:

<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |   
// | http://www.zen-cart.com/index.php                                    |   
// |                                                                      |   
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | [email protected] so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: item.php 1969 2005-09-13 06:57:21Z drbyte $
//

define('MODULE_SHIPPING_ITEM_TEXT_TITLE', 'Per Item');
define('MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION', 'Per Item');
define('MODULE_SHIPPING_ITEM_TEXT_WAY', 'Best Way');
?>
26 Jun 2011, 9:49 PM
#14
boatersplanet avatar

boatersplanet

New Zenner

Join Date:
Aug 2010
Location:
Washington, DC
Posts:
66
Plugin Contributions:
0

Re: Blank Page.. Help!

I have downloaded and uploaded a clean install from the website and I am providing my code below in its entirety:

<?php
/**
 * @package shippingMethod
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: item.php 14498 2009-10-01 20:16:16Z ajeh $
 */


  class item {
    var $code, $title, $description, $icon, $enabled;

// class constructor
    function item() {
      global $order, $db;

      $this->code = 'item';
      $this->title = MODULE_SHIPPING_ITEM_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_ITEM_SORT_ORDER;
      $this->icon = '';
      $this->tax_class = MODULE_SHIPPING_ITEM_TAX_CLASS;
      $this->tax_basis = MODULE_SHIPPING_ITEM_TAX_BASIS;

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
      }

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {
        $check_flag = false;
        $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEM_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while (!$check->EOF) {
          if ($check->fields['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
		  $check->MoveNext();
        }

        if ($check_flag == false) {
          $this->enabled = false;
        }
      }
    }

// class methods
    function quote($method = '') {
      global $order, $total_count;

      // adjusted count for free shipping
      $item_total_count = $total_count - $_SESSION['cart']->free_shipping_items();
      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
                                                     'cost' => (MODULE_SHIPPING_ITEM_COST * $item_total_count) + MODULE_SHIPPING_ITEM_HANDLING)));

      if ($this->tax_class > 0) {
        $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
      }

      if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);

      return $this->quotes;
    }

    function check() {
      global $db;
      if (!isset($this->_check)) {
        $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEM_STATUS'");
        $this->_check = $check_query->RecordCount();
      }
      return $this->_check;
    }

    function install() {
      global $db;
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEM_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_ITEM_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEM_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEM_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_ITEM_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEM_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEM_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }

    function remove() {
      global $db;
      $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key like 'MODULE\_SHIPPING\_ITEM\_%'");
    }

    function keys() {
      return array('MODULE_SHIPPING_ITEM_STATUS', 'MODULE_SHIPPING_ITEM_COST', 'MODULE_SHIPPING_ITEM_HANDLING', 'MODULE_SHIPPING_ITEM_TAX_CLASS', 'MODULE_SHIPPING_ITEM_TAX_BASIS', 'MODULE_SHIPPING_ITEM_ZONE', 'MODULE_SHIPPING_ITEM_SORT_ORDER');
    }
  }
?>
26 Jun 2011, 11:18 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Blank Page.. Help!

All that code belongs in the /includes/modules/ file.
And the code that Ajeh posted belongs in the /includes/languages/ file.

You must NOT interchange them or put them in the wrong places, else you end up with the error message you're reporting.

27 Jun 2011, 4:34 PM
#16
boatersplanet avatar

boatersplanet

New Zenner

Join Date:
Aug 2010
Location:
Washington, DC
Posts:
66
Plugin Contributions:
0

Re: Blank Page.. Help!

DrByte:

All that code belongs in the /includes/modules/ file.
And the code that Ajeh posted belongs in the /includes/languages/ file.

You must NOT interchange them or put them in the wrong places, else you end up with the error message you're reporting.

Well that's embarrassing... but alas it works. Many thanks to you and and Ajeh!!

27 Jun 2011, 5:03 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Blank Page.. Help!

Thanks for the update that you now have your files straightened out ... :smile: