Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modules missing after PHP5


nazron

Recommended Posts

Hi all,

 

After making some recommended changes on several files, finally my admin panel comes back alive. However, I notice that all options normally available after clicking the default modules, i.e. shipping and payment are gone... missing ! Nothing but the install button.

 

Checking in the CONFIGURATION table, the contents related to modules are OK.

 

To make things worse, there is no error message whatsoever.

 

Can anyone help ?

Link to comment
Share on other sites

Got it !

 

After looking at the screen for about a billion times, I only noticed tonight that the base directory for my oscommerce installation is incorrect. True enough, as part of the PHP5 migration, the hosting people also moved my entire installation to a new server with a different directory path and etc.

 

What I did was, I edited admin/includes/configure.php file and re-point the installation to the correct directory and presto ! things are working again.

 

I am glad to finally contribute something to this forum

 

~Nazron

Link to comment
Share on other sites

  • 3 weeks later...
Got it !

 

After looking at the screen for about a billion times, I only noticed tonight that the base directory for my oscommerce installation is incorrect. True enough, as part of the PHP5 migration, the hosting people also moved my entire installation to a new server with a different directory path and etc.

 

What I did was, I edited admin/includes/configure.php file and re-point the installation to the correct directory and presto ! things are working again.

 

I am glad to finally contribute something to this forum

 

~Nazron

 

Thanks

my problem is also fixed... the problem was that for and while do loop thing and the permissions, the Configure.php was correct. and suddenly one day everything is working fine as soon as i change the for and while statements!!!!!! I think changing th permissions worked too!.

thanks anyways

Link to comment
Share on other sites

  • 2 weeks later...
Thanks

my problem is also fixed... the problem was that for and while do loop thing and the permissions, the Configure.php was correct. and suddenly one day everything is working fine as soon as i change the for and while statements!!!!!! I think changing th permissions worked too!.

thanks anyways

 

Hi Samir,

 

What have you changed exactly? I am going through the same problem, but I cannot find any errors.

In what file did you change something about the loop and what, if you still remember?

 

Thanks,

Erick

Link to comment
Share on other sites

I realised I previously posted this probably in the wrong thread (posted form a search but didn't pay attention to which thread it was in. I now realise that this is probably the correct thread, so here goes again! DUH!

 

 

I'm really banging my head against the wall at the moment. I'm running the latest v. - double-checked the 2006.08.17 Update Package and all the mods are in place and the site works fine on the production server (HTTP Server: Apache/1.3.33 (Unix), PHP Version: 4.4.7 (Zend: 1.3.0) , Database: MySQL 5.0.45-log) but I'm having real problems on the dev server (XP Pro SP2, Apache/2.0.58(Win32), PHP Version: 5.1.4(Zend: 2.1.0), MySQL 5.0.22-community-nt)

 

When I go to checkout (checkout_shipping.php) I get a problem with the

shipping Object [modules]

array being empty, so I get an error message (my custom error message) instead of an array of the available shipping options.

 

This install is heavily modified (particularly the shipping options part) so I can't just replace files (they include all the updates I've been able to find anyway)

 

Changed all the $PHP_SELF references to $_SERVER['PHP_SELF'] but my

includes/classes/shipping.php

also calls another file

shipping_address_rates_selection.php

which constructs the array of available methods for the customer's country. Maybe someone could have a look at that and see if there are any changes in there that need to be made for PHP5 compat. This is really frustrating, as everything else is working fine but I need to get this checkout/shipping thing sorted on my dev. server, so I can start work on the CCGV contrib! A solution would be just SOOOOO great!

 

It all works great on the production server but if they decide to upgrade to PHP5, I need to have this working on my current dev. server anyway

 

shipping_address_rates_selection.php

<?php
/*
 $Id: shipping_address_rates_display.php,v 1.15 2003/06/09 23:03:53 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

additional module by Steve Renouf to display only valid shipping modules
in the checkout_shipping_address process when using multiple table shipping
rates. 2006/10/15
*/
/* Collect data from Customers Checkout Data Table for processing */
	$customers_checkout_data_query = tep_db_query("select delivery_country_iso_code_2, long_items_total, total_order_value, shipping_weight, order_processed, customer_data_array, orders_id, paylink_trans_id, orders_identifier, orders_status_id from " . TABLE_CUSTOMERS_CHECKOUT_DATA . " where customers_id = '" . (int)$customer_id . "'");
	$checkout_data_query_result = tep_db_fetch_array($customers_checkout_data_query);

	$del_country_code = $checkout_data_query_result['delivery_country_iso_code_2'];
	$long_item_total = $checkout_data_query_result['long_items_total'];
	$tot_ord_val = $checkout_data_query_result['total_order_value'];
	$total_weight = $checkout_data_query_result['shipping_weight'];
	$identifier = $checkout_data_query_result['orders_identifier'];
/* EOF - Collect data from Customers Checkout Data Table for processing */
global $too_heavy;
global $invalid_country;
global $shipping_method;

/* Set array for selecting the shipping methods */
$shipping_method = array();

/*
Check against delivery country code and allow delivery methods as appropriate
according to value, weight and long item status.
debug:
echo "Shipping Address Rates: ";
echo " Customer ID = " . (int)$customer_id;
echo " / Country Code = " . $del_country_code;
echo " / Long Items = " . $long_item_total;
echo " / Total Order Value = " . $tot_ord_val;
echo " / Shipping Weight = " . $total_weight . "<BR />Make sure this is the new file!!";
*/
switch ($del_country_code){  // switch_1
case "JE":
	if ($total_weight > 30.000){
		$too_heavy = "<font color=#FF0000><B><BR />Sorry, your package is too heavy. Please split your order into smaller orders. <P />Maximum weight is 30Kgs.</B></font><P />";
		$shipping_method[] = array('class' => $too_heavy, 'file' => "");
	}else{
	  if (($tot_ord_val > 500.00) and ($tot_ord_val < 1000.00) and ($long_item_total == FALSE) and ($total_weight < 10.000)){
  			 $shipping_method[] = array('class' => "sd2", 'file' => "sd2.php");
	 }
 		if (($tot_ord_val > 375.00) and ($tot_ord_val <= 500.00) and ($long_item_total == FALSE) and ($total_weight < 10.000)){
 			 $shipping_method[] = array('class' => "sd1", 'file' => "sd1.php");
 		}
 		if (($tot_ord_val <= 375.00) and ($long_item_total == FALSE) and ($total_weight < 10.000)){
 			 $shipping_method[] = array('class' => "locl", 'file' => "locl.php");
 		}
 		if (($tot_ord_val <= 375.00) or ($long_item_total == TRUE) or ($total_weight > 10.000)){
 		$shipping_method[] = array('class' => "locp", 'file' => "locp.php");
		}
	}
	break;
case "GG":
case "GB":
case "IM":
	if ($total_weight > 30.000){
		$too_heavy = "<font color=#FF0000><B><BR />Sorry, your package is too heavy. Please split your order into smaller orders. <P />Maximum weight is 30Kgs.</B></font><P />";
		$shipping_method[] = array('class' => $too_heavy, 'file' => "");
	}else{
	  if (($tot_ord_val > 500.00) and ($tot_ord_val < 1000.00) and ($long_item_total == FALSE) and ($total_weight < 10.000)){
			 $shipping_method[] = array('class' => "sd2", 'file' => "sd2.php");
	 }
 		if (($tot_ord_val > 375.00) and ($tot_ord_val < 500.00) and ($long_item_total == FALSE) and ($total_weight < 10.000)){
 			 $shipping_method[] = array('class' => "sd1", 'file' => "sd1.php");
 		}
 		if (($tot_ord_val <= 375.00) and ($long_item_total == FALSE) and ($total_weight < 10.000)){
 			 $shipping_method[] = array('class' => "domlet", 'file' => "domlet.php");
 		}
 		if (($tot_ord_val <= 375.00) or ($long_item_total == TRUE) or ($total_weight > 10.000)){
		  $shipping_method[] = array('class' => "dompar", 'file' => "dompar.php");
		}
	}
	break;	
case 'AT':
case 'HR':
case 'CZ':
case 'DK':
case 'FR':
case 'DE':
case 'IE':
case 'IT':	// EU zone A
case 'LU':
case 'NL':
case 'MK':
case 'SK':
case 'SI':
case 'ES':
case 'CH':
	if ($total_weight > 20.000){
// ToDo - put into osC standard language files
		$too_heavy = "<font color=#FF0000><B><BR />Sorry, your package is too heavy. Please split your order into smaller orders. <P />Maximum weight is 20Kgs.</B></font><P />";
		$shipping_method[] = array('class' => $too_heavy, 'file' => "");
	}else{
  		if (($long_item_total == FALSE) and ($total_weight < 2.000)){
  			 $shipping_method[] = array('class' => "intletzeu", 'file' => "intletzeu.php");
  		}
		$shipping_method[] = array('class' => "intparza", 'file' => "intparza.php");
	}
	break;		
case 'BE':
case 'BA':
case 'BG':
case 'GI':
case 'HU':
case 'LV':	 //  EU zone B
case 'LI':
case 'LT':
case 'NO':
case 'PL':
case 'SE':
	if ($total_weight > 20.000){
		$too_heavy = "<font color=#FF0000><B><BR />Sorry, your package is too heavy. Please split your order into smaller orders. <P />Maximum weight is 20Kgs.</B></font><P />";
		$shipping_method[] = array('class' => $too_heavy, 'file' => "");
	}else{
  		if (($long_item_total == FALSE) and ($total_weight < 2.000)){
  			 $shipping_method[] = array('class' => "intletzeu", 'file' => "intletzeu.php");
  		}
		$shipping_method[] = array('class' => "intparzb", 'file' => "intparzb.php");
	}
	break;
 case('BY'):	 
  case('CY'):	 
  case('FI'):	 
  case('GR'):	 
  case('GL'):	 
  case('IS'):	 // Zone C - EU  (NEW ZONE 5)
  case('MT'):	 
  case('MC'):	 
  case('PT'):	 
  case('RO'):	 
  case('CS'):	 
  case('TR'):	 
  case('UA'):
	if ($total_weight > 20.000){
		$too_heavy = "<font color=#FF0000><B><BR />Sorry, your package is too heavy. Please split your order into smaller orders. <p />Maximum weight is 20Kgs.</B></font><P />";
		$shipping_method[] = array('class' => $too_heavy, 'file' => "");
	}else{
  		if (($long_item_total == FALSE) and ($total_weight < 2.000)){
  			 $shipping_method[] = array('class' => "intletzeu", 'file' => "intletzeu.php");
  		}
		$shipping_method[] = array('class' => "intparzc", 'file' => "intparzc.php");
	}
	break;
 case('CA'):
 case('ZA'):	   // Zone E - ROW  (NEW ZONE 7)
 case('TH'):
 case('IL'):
 case('US'):
	if ($total_weight > 20.000){
		$too_heavy = "<font color=#FF0000><B><BR />Sorry, your package is too heavy. Please split your order into smaller orders. <P />Maximum weight is 20Kgs.</B></font><P />";
		$shipping_method[] = array('class' => $too_heavy, 'file' => "");
	}else{
  		if (($long_item_total == FALSE) and ($total_weight < 2.000)){
  			 $shipping_method[] = array('class' => "intletz1", 'file' => "intletz1.php");
  		}
  		$shipping_method[] = array('class' => "intparze", 'file' => "intparze.php");
	}
	break;  
 case('JP'):				// (NEW ZONE 8)
	if ($total_weight > 20.000){
		$too_heavy = "<font color=#FF0000><B><BR />Sorry, your package is too heavy. Please split your order into smaller orders. <P />Maximum weight is 20Kgs.</B></font><P />";
		$shipping_method[] = array('class' => $too_heavy, 'file' => "");
	}else{
  		if (($long_item_total == FALSE) and ($total_weight < 2.000)){
  			 $shipping_method[] = array('class' => "intletz2", 'file' => "intletz2.php");
  		}
  		$shipping_method[] = array('class' => "intparze", 'file' => "intparze.php");
	}
	break;						  
 case('RU'):				// (NEW ZONE 6)
	if ($total_weight > 20.000){
		$too_heavy = "<font color=#FF0000><B><BR />Sorry, your package is too heavy. Please split your order into smaller orders. <P />Maximum weight is 20Kgs.</B></font><P />";
		$shipping_method[] = array('class' => $too_heavy, 'file' => "");
	}else{
  		if (($long_item_total == FALSE) and ($total_weight < 2.000)){
  			 $shipping_method[] = array('class' => "intletzeu", 'file' => "intletzeu.php");
  		}
  		$shipping_method[] = array('class' => "intparze", 'file' => "intparze.php");
	}
	break;
default:
	$invalid_country = TRUE;
	$shipping_method[] = array('class' => $invalid_country, 'file' => "");
	break;

}  // end_switch_1
?>

Once I have all this latest PHP5 compat. stuff sorted, I'll try to find time to put this together as a contrib. (There's quite a bit of other stuff that goes with this to make it work - e.g. extra tables etc.). It allows you to have as many different shipping rates/selection criteria as you like but only show the ones that are valid for a particular delivery country for the customer to select. For instance, we currently have 13 different rates based on weight/length/destination. (As you can probably determine from the above file).

* * * * * * * * * * * * * * * * * * * * *

Porpoises are most happy when wet!

\ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _

Link to comment
Share on other sites

Perhaps add a global $customer_id; on the line above the query that uses it?

 

 

Hmmmm..... After further investigation, I don't think the problem is in that file at all. Instead of calling it from within

includes/classes/shipping.php

, I moved the call to

checkout_shipping.php

- just before the call to

includes/classes/shipping.php

and all the arrays/variables echo fine from that file, so they are definitely populated for the

includes/classes/shipping.php

to use. That means the issue must be something within the

includes/classes/shipping.php

file itself. Maybe it's something to do with classes!?!

 

I'll try a new search in the Forums - I'm sure I saw something previously on class issues between PHP4 & PHP5

* * * * * * * * * * * * * * * * * * * * *

Porpoises are most happy when wet!

\ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _

Link to comment
Share on other sites

Who don't you add the code to the class itself then?

 

Further investigations reveal (via debugging code) that the class is not passing back the data - it's just returning an empty array. I suspect this is something to do with the new way that PHP5 handles class objects. I'm sure I spotted something about this in another thread somewhere but using a search doesn't seem to bring obvious thread forward.

 

Guess I'll just have to slog through a mountain of threads...... <_<

* * * * * * * * * * * * * * * * * * * * *

Porpoises are most happy when wet!

\ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _

Link to comment
Share on other sites

  • 4 weeks later...
Thanks

my problem is also fixed... the problem was that for and while do loop thing and the permissions, the Configure.php was correct. and suddenly one day everything is working fine as soon as i change the for and while statements!!!!!! I think changing th permissions worked too!.

thanks anyways

 

Can you please explain this FOR and WHILE... How and where do I find these codes? I have lost my shipping modules in admin. I can see some of the ones that are left but I cannot edit them. Help please...

Link to comment
Share on other sites

Hi all,

 

After making some recommended changes on several files, finally my admin panel comes back alive. However, I notice that all options normally available after clicking the default modules, i.e. shipping and payment are gone... missing ! Nothing but the install button.

 

Checking in the CONFIGURATION table, the contents related to modules are OK.

 

To make things worse, there is no error message whatsoever.

 

Can anyone help ?

Can you offer me some suggestion as to how I can fix the problem of some of my shipping modules disappearing. I also cannot edit those that are left. However, I can view the modules if I visit the site on line. I am just not able to access them in the admin area. My Zone rate module and my USPS module do not show period.

 

Thanks for your help in advance.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...