Have installed everything fresh, but I still get the same problem. The product is added to the cart instead of wishlist.
Here is my application top code around where changes were needed.
First chancge:
// include shopping cart class
require(DIR_WS_CLASSES . 'shopping_cart.php');
// include wishlist class
require(DIR_WS_CLASSES . 'wishlist.php');
// include navigation history class
require(DIR_WS_CLASSES . 'navigation_history.php');
Second change:
// navigation history
if (tep_session_is_registered('navigation')) {
if (PHP_VERSION < 4) {
$broken_navigation = $navigation;
$navigation = new navigationHistory;
$navigation->unserialize($broken_navigation);
}
} else {
tep_session_register('navigation');
$navigation = new navigationHistory;
}
$navigation->add_current_page();
// wishlist data
if(!tep_session_is_registered('wishList')) {
tep_session_register('wishList');
$wishList = new wishlist;
}
//Wishlist actions (must be before shopping cart actions)
if(isset($HTTP_POST_VARS['wishlist_x'])) {
if(isset($HTTP_POST_VARS['products_id'])) {
if(isset($HTTP_POST_VARS['id'])) {
$attributes_id = $HTTP_POST_VARS['id'];
tep_session_register('attributes_id');
}
$wishlist_id = $HTTP_POST_VARS['products_id'];
tep_session_register('wishlist_id');
}
tep_redirect(tep_href_link(FILENAME_WISHLIST));
}
// Shopping cart actions
if (isset($HTTP_GET_VARS['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));
}
if (DISPLAY_CART == 'true') {
$goto = FILENAME_SHOPPING_CART;
$parameters = array('action', 'cPath', 'products_id', 'pid');
} else {
$goto = basename($PHP_SELF);
if ($HTTP_GET_VARS['action'] == 'buy_now') {
$parameters = array('action', 'pid', 'products_id');
} else {
$parameters = array('action', 'pid');
Is the code correct?