wiko85 ha scritto:Si, se scarichi la contribution e effettui le modifiche al contrario.
si, ho fatto così infatti ed è andato tutto bene...
ops, forse ho parlato prima del tempo...
in application_top.php se elimino il codice del wish_list mi da errore il sito...
il codice è questo...
Codice: Seleziona tutto
// Wish List 2.3 Start
// *****************************************
// Remove item from the Wish List
case 'remove_wishlist':
tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id= '" . $HTTP_GET_VARS['pid'] . "'");
tep_redirect(tep_href_link(FILENAME_WISHLIST));
break;
} // end switch $HTTP_GET_VARS['action']
} // end if is set $HTTP_GET_VARS['action']
// Shopping cart actions through POST variables from forms
if (isset($HTTP_POST_VARS['wishlist_action'])) {
// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
if ($session_started == false) {
tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
}
$goto = basename($PHP_SELF);
switch ($HTTP_POST_VARS['wishlist_action']) {
// Customer wants to update the product quantity in their shopping cart
case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
if ($HTTP_POST_VARS['products_id']) {
if ($customer_id > 0) {
// Queries below replace old product instead of adding to queatity.
tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )");
tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
// Read array of options and values for attributes in id[]
if (isset ($id)) {
foreach($id as $att_option=>$att_value) {
// Add to customers_wishlist_attributes table
tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )");
}
}
}
}
}
break;
case 'wishlist_add_cart' :if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
if ($HTTP_POST_VARS['products_id']) {
if ($customer_id > 0) {
tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
// Read array of options and values for attributes in id[]
if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
}
}
}
break;
// Wishlist Checkboxes
case 'add_delete_products_wishlist':
if (isset($HTTP_POST_VARS['add_wishprod'])) {
if ($HTTP_POST_VARS['borrar'] == 0) {
// 'borrar' form variable refers to deleting products in array $add_wishprod[] from wishlist
foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
if (ereg('^[0-9]+$', $value)) {
$cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]);
tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '$value' and customers_id = '" . $customer_id . "'");
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
}
if ($HTTP_POST_VARS['borrar'] == 1) {
foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
if (ereg('^[0-9]+$', $value)) {
tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '$value' and customers_id = '" . $customer_id . "'");
}
}
tep_redirect(tep_href_link(FILENAME_WISHLIST));
}
}
break;
} // end switch ($HTTP_POST_VARS['wishlist_action'])
} // end isset($HTTP_POST_VARS)
// *****************************************
// Wish List 2.3 End