Try:
http://www.zen-cart.com/forum/showth...light=wishlist
http://www.unevolution.com/downloads/access.php?id=1000
If you are using v1.3.0, you need to skip steps 2,3 and 4 in the installation manual that is supplied with the wishlist contribution. Instead create a new php file and paste the following php code into it:
Code:
<?php
/**
* Main shopping Cart actions supported.
*
* The main cart actions supported by the current shoppingCart class.
* This can be added to externally using the extra_cart_actions directory.
*
* @package initSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id:wishlist_cart_actions.php 3066 2006-02-25 22:14:00Z wilt $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
/**
* include the list of extra cart action files (*.php in the extra_cart_actions folder)
*/
switch ($_GET['action']) {
// (un): start mod for Wishlist v0.2
// Add item to wishlist
case 'un_add_wishlist':
if ($_SESSION['customer_id'] && isset($_GET['products_id'])) {
// use wishlist class
require_once(DIR_WS_CLASSES . 'un_wishlist.class.php');
$oWishlist = new un_wishlist($_SESSION['customer_id']);
$oWishlist->addProduct($_GET['products_id']);
}
zen_redirect(zen_href_link(UN_FILENAME_WISHLIST));
break;
// Remove item from wishlist
case 'un_remove_wishlist':
if ($_SESSION['customer_id'] && isset($_GET['products_id'])) {
// use wishlist class
require_once(DIR_WS_CLASSES . 'un_wishlist.class.php');
$oWishlist = new un_wishlist($_SESSION['customer_id']);
$oWishlist->removeProduct($_GET['products_id']);
}
zen_redirect(zen_href_link(UN_FILENAME_WISHLIST));
break;
// Update wishlist
case 'un_update_wishlist':
$cart_updated = false;
for ($i=0; $i<sizeof($_POST['products_id']); $i++) {
// use wishlist class
require_once(DIR_WS_CLASSES . 'un_wishlist.class.php');
$oWishlist = new un_wishlist($_SESSION['customer_id']);
$oWishlist->updateProduct((int)$_POST['products_id'][$i], (int)$_POST['wishlist_quantity'][$i], (int)$_POST['priority'][$i], $_POST['comment'][$i]);
if ( in_array($_POST['products_id'][$i], (is_array($_POST['add_to_cart']) ? $_POST['add_to_cart'] : array())) && $_POST['wishlist_quantity'][$i] != 0 ) {
$cart_updated = true;
$_SESSION['cart']->add_cart($_POST['products_id'][$i], $_SESSION['cart']->get_quantity(zen_get_uprid($_POST['products_id'][$i], ''))+$_POST['wishlist_quantity'][$i], '');
}
if ( in_array($_POST['products_id'][$i], (is_array($_POST['wishlist_delete']) ? $_POST['wishlist_delete'] : array())) or $_POST['wishlist_quantity'][$i] == 0 ) {
$oWishlist->removeProduct((int)$_POST['products_id'][$i]);
}
}
if ( $cart_updated == true ) {
zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
} else {
zen_redirect(zen_href_link(UN_FILENAME_WISHLIST, zen_get_all_get_params($parameters)));
}
break;
// (un): end mod for Wishlist v0.2
}
?>
Then save the new php file in the /includes/extra_cart_actions/ folder. Continue with steps 5 and 6 in the wishlist contribution installation manual.
Bookmarks