Help! Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expectin

Help I’m not quite sure whats wrong but I got this error after adding an osc addon:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘]’ in /home/content/19/8951719/html/includes/classes/shipping.php on line 59

I am a new to php and coun’t find the error.

Line 59: if (defined(‘MODULE_SHIPPING_INSTALLED’) && tep_not_null(MODULE_SHIPPING_INSTALLED)) {

is tep_not_null a functions as i haven’t seen this before. if it is have you tried putting quotation marks around MODULE_SHIPPING_INSTALLED?

Could you post a little more code. At lease the line of code before the one that is issuing the error. Make sure it is terminated with a semi-colon and doesn’t have any unclosed single or double quotes.

Here is some more of the code

// INDIV_SM BEGIN (this is messy i know)
  global $cart;
  // New to fix attributes bug
  $cart_products = $cart->get_products();
  $real_ids = array();
  foreach($cart_products as $prod){
  	$real_ids[] = tep_get_prid($prod['id']);
  }
	$sql = "SELECT shipping_methods FROM ".TABLE_PRODUCTS." WHERE products_id IN (".implode(',',$real_ids).") AND shipping_methods IS NOT NULL AND shipping_methods <> ''";
	$query = mysql_query($sql);
  // End new bug fix
	$allow_mod_array = array();
	while($rec = mysql_fetch_array($query)){
		if(empty($allow_mod_array)) $startedempty = true;
		$methods_array = array();
		$methods_array = explode(';',$rec[shipping_methods']);
		if(!empty($methods_array)){
			foreach($methods_array as $method){
				$allow_mod_array[] = $method;
			}
		}
		if($startedempty){
			$startedempty = false;
		}else{
			$temp_array = array();
			foreach($allow_mod_array as $val){
				$temp_array[$val]++;
			}
			$allow_mod_array = array();
			foreach($temp_array as $key => $val){
				if($val > 1){
					$allow_mod_array[] = $key;
				}
			}
		}
	}
  // INDIV_SM END

  if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) {
    $this->modules = explode(';', MODULE_SHIPPING_INSTALLED);

	// INDIV_SM START
	$temp_array = $this->modules;
	$this->modules = array();
	foreach($temp_array as $val){
		if(mysql_num_rows($query)==0 || in_array(str_replace('.php','',$val),$allow_mod_array)) {
			$this->modules[] = $val;
		}
	}
	// INDIV_SM END

    $include_modules = array();

    if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
      $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));
    } else {
      reset($this->modules);
      while (list(, $value) = each($this->modules)) {
        $class = substr($value, 0, strrpos($value, '.'));
        $include_modules[] = array('class' => $class, 'file' => $value);
      }
    }

    for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
      include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']);
      include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']);

      $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];
    }
  }
}

function quote($method = '', $module = '') {
  global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;

  $quotes_array = array();

  if (is_array($this->modules)) {
    $shipping_quoted = '';
    $shipping_num_boxes = 1;
    $shipping_weight = $total_weight;

    if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {
      $shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;
    } else {
      $shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100);
    }

    if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes
      $shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT);
      $shipping_weight = $shipping_weight/$shipping_num_boxes;
    }

    $include_quotes = array();

    reset($this->modules);
    while (list(, $value) = each($this->modules)) {
      $class = substr($value, 0, strrpos($value, '.'));
      if (tep_not_null($module)) {
        if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) {
          $include_quotes[] = $class;
        }
      } elseif ($GLOBALS[$class]->enabled) {
        $include_quotes[] = $class;
      }
    }
Sponsor our Newsletter | Privacy Policy | Terms of Service