Hallo Leute,
ich Flipp bald aus.
Hab hier eine Funktion:
Bekomme aber immer die Fehlermeldung:
Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /www/htdocs/test/inc/classes/cart.php on line 61
Line 61 ist in meinem Fall:
Wo kann denn der verflixte Fehler liegen.
Für Tipps wäre ich sehr dankbar.
Gruss
ich Flipp bald aus.
Hab hier eine Funktion:
PHP:
<? function restore_contents() {
//ICW replace line
global $customer_id, $gv_id, $REMOTE_ADDR;
// global $customer_id;
if (!tep_session_is_registered('customer_id')) return false;
// insert current cart contents in database
if (is_array($this->contents)) {
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
$qty = $this->contents[$products_id]['qty'];
$product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
if (!tep_db_num_rows($product_query)) {
tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");
if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
}
}
} else {
tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $qty . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
}
}
}
//ICW ADDDED FOR CREDIT CLASS GV - START
if (tep_session_is_registered('gv_id')) {
$gv_query = tep_db_query("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $gv_id . "', '" . (int)$customer_id . "', now(),'" . $REMOTE_ADDR . "')");
$gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $gv_id . "'");
tep_gv_account_update($customer_id, $gv_id);
tep_session_unregister('gv_id');
}
//ICW ADDDED FOR CREDIT CLASS GV - END
}
// reset per-session cart contents, but not the database contents
$this->reset(false);
$products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
while ($products = tep_db_fetch_array($products_query)) {
$this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']);
// attributes
$attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
while ($attributes = tep_db_fetch_array($attributes_query)) {
$this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
}
}
$this->cleanup();
}
?>
Bekomme aber immer die Fehlermeldung:
Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /www/htdocs/test/inc/classes/cart.php on line 61
Line 61 ist in meinem Fall:
PHP:
// reset per-session cart contents, but not the database contents
$this->reset(false);
Wo kann denn der verflixte Fehler liegen.
Für Tipps wäre ich sehr dankbar.
Gruss