Jump to content
defender39

Wishlist 2.0 Support Thread

Recommended Posts

I have the wishlist working properly now, so if I could only get the e-mails sent right, too, I'll call this a wrap! I'm sure 3.5 has a lot more features than 2.4, but this will do for now LOL

 

The e-mails are being sent out, but instead of listing each item as a link, it's just listing them like this (if it was fruit I'm selling) AppleBananaKiwi etc

 

I've tried to edit the code myself, but without luck so far. I'm pretty sure I'm looking in the right area, though... It has to be somewhere in this query, am I correct? This is the original code from wishlist_email.php

 

<?
 $wishliststring = FORM_FIELD_TEXT_AREA;

 $wishlist_query_raw = "select tab2.products_id, tab1.products_name from " . TABLE_WISHLIST . " as tab2, " . TABLE_PRODUCTS_DESCRIPTION . " as tab1 where tab2.customers_id='" . (int)$customer_id . "' and tab1.products_id = tab2.products_id and tab1.language_id = '" . (int)$languages_id . "' order by products_name";

 $wishlist_query = tep_db_query($wishlist_query_raw);
while ($resultarray=mysql_fetch_row($wishlist_query)) {
$wishliststring .=""."<li><a href=\"".HTTP_SERVER . DIR_WS_CATALOG ."product_info.php?products_id=".$resultarray[0] ."\">".$resultarray[1] ."</a></li>"."";
}
?>

 

If anyone who knows more about php code than I do could point me in the right direction, I'd be most grateful!

:)

Share this post


Link to post
Share on other sites

I didnt do 2.4 I did 3.x. The code in 2.4 is crappy and from looking at that I would rewrite that whole query and left join the table products_desc.. into the query and use the osc fucntions calls to the db and not the actual mysql calls.

 

Get 3.x working as it runs better and is "guest enhanced" which means guest can use the wishlist and when they signup it transfers to their permanent wishlist. Another feature to get them to signup, allow them to use it but it don't save unless they signup ;). But they can still email it to their friends.

 

Good luck.

Share this post


Link to post
Share on other sites

Hiya,

 

Can you please tell me what you did to get things to show up after you've added them to the wish list? I seem to have the same problem you had the other day... using wishlist 2.2, when you add something to the wishlist and then go to view your wishlist it says 'showing 1 of 1' but with nothing there. And so when you email the wishlist to a friend the email comes through without any items on it.

It's at

http://www.kjcollection.co.uk/catalog

http://www.kjcollection.co.uk/catalog/wishlist.php

 

Would be v v grateful if you had chance to let me know what you did to solve this problem!

 

Lisa x

Share this post


Link to post
Share on other sites
and when they signup it transfers to their permanent wishlist

 

Hey, is it possible to make the guest wishlist be the 'permanent' wishlist?

Share this post


Link to post
Share on other sites

Would there be a way on the wishlist page, to be able to see other registered users with the same products on their wishlist?

 

I would also like to have just the item on the wishlist page, without the product attributes. Can I just comment out the attributes section of wishlist_public.html?

 

Thanks

 

-Mike

Share this post


Link to post
Share on other sites

Hi all;

 

Newbie here with a quick question. I'm thinking about

installing this contrib, which sounds great, but am wondering

which is the newest, fullest version to install.

 

Suggestions?

 

Thanks in advance,

Karen

Share this post


Link to post
Share on other sites

Hi Dennis;

 

I've installed 3.5d and the fix in catalog/wishlist_public.php

Your instructions were very easy to follow, and being a newbie,

I thank you very much for that :D

 

I only have 2 questions for you though.

 

I've uploaded the help files which brings up Wishlist FAQ on my

site. Are there additional help files for this section? Or is there

a way to comment out the "Click here for help with your wishlist"?

 

Second : I've placed the code to show the link for the WishList

into my header, however I was wondering if there is a way to

place the link into the header bar next to My Account instead of

having a seperate bar as it appears on the site? Here's a link so

you can see what I mean -

http://ladykdelights.com/cart/wishlist_help.php?

 

Thanks in advance for your help and I wish you a very Merry

Christmas,

Karen

Share this post


Link to post
Share on other sites
Hi Dennis;

 

I've installed 3.5d and the fix in catalog/wishlist_public.php

Your instructions were very easy to follow, and being a newbie,

I thank you very much for that :D

 

I only have 2 questions for you though.

 

I've uploaded the help files which brings up Wishlist FAQ on my

site. Are there additional help files for this section? Or is there

a way to comment out the "Click here for help with your wishlist"?

 

Second : I've placed the code to show the link for the WishList

into my header, however I was wondering if there is a way to

place the link into the header bar next to My Account instead of

having a seperate bar as it appears on the site? Here's a link so

you can see what I mean -

http://ladykdelights.com/cart/wishlist_help.php?

 

Thanks in advance for your help and I wish you a very Merry

Christmas,

Karen

 

 

Never mind .... I monkeyed with the code and managed to insert the

link where I wanted it. Good old trial and error lol. :D

Share this post


Link to post
Share on other sites

Can anyone tell me why products_id in the customers_wishlist table would be a memo field? It's keeping me from doing joins and managing the data outside of osC...

Share this post


Link to post
Share on other sites

Hi - I need help PLEASE, I installed the contrib,exactly like the install instructions..but I get this error when trying to run the file...(admin is fine)

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/ticktick/public_html/get/includes/header.php:194) in /home/ticktick/public_html/get/includes/boxes/categories.php on line 13

 

can anyone please assist me ?


Lets do this while we can . . .

Share this post


Link to post
Share on other sites

Have problems in application_top.php:

 

The wrong message:

Parse error: parse error, unexpected T_CASE in /home/kunder/9503/web-wings.net/catalog/includes/application_top.php on line 485

 

<?php
/*
 $Id: application_top.php,v 1.280 2003/07/12 09:38:07 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// start the timer for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime());

// set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE);

// check if register_globals is enabled.
// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 if (function_exists('ini_get')) {
ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
 }

// Set the local configuration parameters - mainly for developers
 if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

// include server parameters
 require('includes/configure.php');

 if (strlen(DB_SERVER) < 1) {
if (is_dir('install')) {
  header('Location: install/index.php');
}
 }

// define the project version
 define('PROJECT_VERSION', 'osCommerce 2.2-MS2');

// set the type of request (secure or not)
 $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

// set php_self in the local scope
 if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

 if ($request_type == 'NONSSL') {
define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
 } else {
define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
 }

// include the list of project filenames
 require(DIR_WS_INCLUDES . 'filenames.php');

// include the list of project database tables
 require(DIR_WS_INCLUDES . 'database_tables.php');

// customization for the design layout
 define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

// include the database functions
 require(DIR_WS_FUNCTIONS . 'database.php');

// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');

// set the application parameters
 $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 while ($configuration = tep_db_fetch_array($configuration_query)) {
define($configuration['cfgKey'], $configuration['cfgValue']);
 }

// if gzip_compression is enabled, start to buffer the output
 if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {
if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {
  if (PHP_VERSION >= '4.0.4') {
	ob_start('ob_gzhandler');
  } else {
	include(DIR_WS_FUNCTIONS . 'gzip_compression.php');
	ob_start();
	ob_implicit_flush();
  }
} else {
  ini_set('zlib.output_compression_level', GZIP_LEVEL);
}
 }

// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled
 if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
if (strlen(getenv('PATH_INFO')) > 1) {
  $GET_array = array();
  $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
  $vars = explode('/', substr(getenv('PATH_INFO'), 1));
  for ($i=0, $n=sizeof($vars); $i<$n; $i++) {
	if (strpos($vars[$i], '[]')) {
	  $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];
	} else {
	  $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];
	}
	$i++;
  }

  if (sizeof($GET_array) > 0) {
	while (list($key, $value) = each($GET_array)) {
	  $HTTP_GET_VARS[$key] = $value;
	}
  }
}
 }

// define general functions used application-wide
 require(DIR_WS_FUNCTIONS . 'general.php');
 require(DIR_WS_FUNCTIONS . 'html_output.php');

// set the cookie domain
 $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);
 $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);

// include cache functions if enabled
 if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php');

// 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');

// some code to solve compatibility issues
 require(DIR_WS_FUNCTIONS . 'compatibility.php');

// check if sessions are supported, otherwise use the php3 compatible session class
 if (!function_exists('session_start')) {
define('PHP_SESSION_NAME', 'osCsid');
define('PHP_SESSION_PATH', $cookie_path);
define('PHP_SESSION_DOMAIN', $cookie_domain);
define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

include(DIR_WS_CLASSES . 'sessions.php');
 }

// define how the session functions will be used
 require(DIR_WS_FUNCTIONS . 'sessions.php');

// set the session name and save path
 tep_session_name('osCsid');
 tep_session_save_path(SESSION_WRITE_DIRECTORY);

// set the session cookie parameters
  if (function_exists('session_set_cookie_params')) {
session_set_cookie_params(0, $cookie_path, $cookie_domain);
 } elseif (function_exists('ini_set')) {
ini_set('session.cookie_lifetime', '0');
ini_set('session.cookie_path', $cookie_path);
ini_set('session.cookie_domain', $cookie_domain);
 }

// set the session ID if it exists
  if (isset($HTTP_POST_VARS[tep_session_name()])) {
 tep_session_id($HTTP_POST_VARS[tep_session_name()]);
  } elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) {
 tep_session_id($HTTP_GET_VARS[tep_session_name()]);
  }

// start the session
 $session_started = false;
 if (SESSION_FORCE_COOKIE_USE == 'True') {
tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);

if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
  tep_session_start();
  $session_started = true;
}
 } elseif (SESSION_BLOCK_SPIDERS == 'True') {
$user_agent = strtolower(getenv('HTTP_USER_AGENT'));
$spider_flag = false;

if (tep_not_null($user_agent)) {
  $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

  for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {
	if (tep_not_null($spiders[$i])) {
	  if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
		$spider_flag = true;
		break;
	  }
	}
  }
}

if ($spider_flag == false) {
  tep_session_start();
  $session_started = true;
}
 } else {
tep_session_start();
$session_started = true;
 }

// set SID once, even if empty
 $SID = (defined('SID') ? SID : '');

// verify the ssl_session_id if the feature is enabled
 if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {
$ssl_session_id = getenv('SSL_SESSION_ID');
if (!tep_session_is_registered('SSL_SESSION_ID')) {
  $SESSION_SSL_ID = $ssl_session_id;
  tep_session_register('SESSION_SSL_ID');
}

if ($SESSION_SSL_ID != $ssl_session_id) {
  tep_session_destroy();
  tep_redirect(tep_href_link(FILENAME_SSL_CHECK));
}
 }

// verify the browser user agent if the feature is enabled
 if (SESSION_CHECK_USER_AGENT == 'True') {
$http_user_agent = getenv('HTTP_USER_AGENT');
if (!tep_session_is_registered('SESSION_USER_AGENT')) {
  $SESSION_USER_AGENT = $http_user_agent;
  tep_session_register('SESSION_USER_AGENT');
}

if ($SESSION_USER_AGENT != $http_user_agent) {
  tep_session_destroy();
  tep_redirect(tep_href_link(FILENAME_LOGIN));
}
 }

// verify the IP address if the feature is enabled
 if (SESSION_CHECK_IP_ADDRESS == 'True') {
$ip_address = tep_get_ip_address();
if (!tep_session_is_registered('SESSION_IP_ADDRESS')) {
  $SESSION_IP_ADDRESS = $ip_address;
  tep_session_register('SESSION_IP_ADDRESS');
}

if ($SESSION_IP_ADDRESS != $ip_address) {
  tep_session_destroy();
  tep_redirect(tep_href_link(FILENAME_LOGIN));
}
 }

// create the shopping cart & fix the cart if necesary
 if (tep_session_is_registered('cart') && is_object($cart)) {
if (PHP_VERSION < 4) {
  $broken_cart = $cart;
  $cart = new shoppingCart;
  $cart->unserialize($broken_cart);
}
 } else {
tep_session_register('cart');
$cart = new shoppingCart;
 }

// include currencies class and create an instance
 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

// include the mail classes
 require(DIR_WS_CLASSES . 'mime.php');
 require(DIR_WS_CLASSES . 'email.php');

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
if (!tep_session_is_registered('language')) {
  tep_session_register('language');
  tep_session_register('languages_id');
}

include(DIR_WS_CLASSES . 'language.php');
$lng = new language();

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
  $lng->set_language($HTTP_GET_VARS['language']);
} else {
  $lng->get_browser_language();
}

$language = $lng->language['directory'];
$languages_id = $lng->language['id'];
 }

// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');

// currency
 if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {
if (!tep_session_is_registered('currency')) tep_session_register('currency');

if (isset($HTTP_GET_VARS['currency'])) {
  if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
} else {
  $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
}
 }

// 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();

// BOF: Down for Maintenance except for admin ip
if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR')){
if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }
}
// do not let people get to down for maintenance page if not turned on
if (DOWN_FOR_MAINTENANCE=='false' and strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) {
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}
// EOF: WebMakers.com Added: Down for Maintenance

// Shopping cart actions
// 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)); }
 require(DIR_WS_FUNCTIONS . 'buy_two_func.php');
 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');
  }
}
switch ($HTTP_GET_VARS['action']) {
  // customer wants to update the product quantity in their shopping cart
  case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {
							if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {
							  $cart->remove($HTTP_POST_VARS['products_id'][$i]);
							} else {
							  if (PHP_VERSION < 4) {
								// if PHP3, make correction for lack of multidimensional array.
								reset($HTTP_POST_VARS);
								while (list($key, $value) = each($HTTP_POST_VARS)) {
								  if (is_array($value)) {
									while (list($key2, $value2) = each($value)) {
									  if (ereg ("(.*)\]\[(.*)", $key2, $var)) {
										$id2[$var[1]][$var[2]] = $value2;
									  }
									}
								  }
								}
								$attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';
							  } else {
								$attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';
							  }
							  $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);
							}
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;
  // customer adds a product from the products page
  case 'add_product' :	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;
  // performed by the 'buy now' button in product listings and review page
  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {
								  //Wishlist 2.0.1 Modification
							if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id"); }
							// End Wishlist 2.0.1 Modification
							if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
							  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
							} else {
							  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
							}
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;
  case 'notify' :		 if (tep_session_is_registered('customer_id')) {
							if (isset($HTTP_GET_VARS['products_id'])) {
							  $notify = $HTTP_GET_VARS['products_id'];
							} elseif (isset($HTTP_GET_VARS['notify'])) {
							  $notify = $HTTP_GET_VARS['notify'];
							} elseif (isset($HTTP_POST_VARS['notify'])) {
							  $notify = $HTTP_POST_VARS['notify'];
							} else {
							  tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
							}
							if (!is_array($notify)) $notify = array($notify);
							for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
							  $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");
							  $check = tep_db_fetch_array($check_query);
							  if ($check['count'] < 1 && $notify[$i] > 0) {
								tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
							  }
							}
							tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
						  } else {
							$navigation->set_snapshot();
							tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
						  }
						  break;
  case 'notify_remove' :  if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {
							$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
							$check = tep_db_fetch_array($check_query);
							if ($check['count'] > 0) {
							  tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
							}
							tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));
						  } else {
							$navigation->set_snapshot();
							tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
						  }
						  break;
  case 'cust_order' :	 if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
// Wishlist 2.0.1 Modification
							  tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
// End Wishlist 2.0.1 Modification
							if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
							  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));
							} else {
							  $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
							}
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;
														//Wishlist 2.0.1 Modification
// Add product to the wishlist

  case 'add_wishlist' :  if (ereg('^[0-9]+$', $HTTP_GET_VARS['products_id'])) {
						  if  ($HTTP_GET_VARS['products_id']) {
						tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_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_redirect(tep_href_link(FILENAME_WISHLIST));
	break;

 // Add wishlist item to the cart
case 'wishlist_add_cart': reset ($lvnr);
					   reset ($lvanz);
							 while (list($key,$elem) =each ($lvnr))
								   {
									(list($key1,$elem1) =each ($lvanz));
									tep_db_query("update " . TABLE_WISHLIST . " SET products_quantity=$elem1 WHERE customers_id=$customer_id AND products_id=$elem");
									tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_quantity='999'");
									$produkte_mit_anzahl=tep_db_query("select * from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$elem AND products_quantity<>'0'");

									while ($HTTP_GET_VARS=mysql_fetch_array($produkte_mit_anzahl))
										  {
										   $cart->add_cart($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['products_quantity']);
										   }
									}
							  reset ($lvanz);
						  tep_redirect(tep_href_link(FILENAME_WISHLIST));
						  break;


// remove item from the wishlist
///// CHANGES TO case 'remove_wishlist' BY DREAMSCAPE /////
  case 'remove_wishlist' :
						 tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
						tep_redirect(tep_href_link(FILENAME_WISHLIST));
						 break;
//End Wishlist 2.0.1 Modification

}
 }

case 'auroranien' :		  

if (isset($HTTP_GET_VARS['products_id'])) {
if (BUY_TWO_DISCOUNT_BUNDLE == 'normal') {
if ($HTTP_GET_VARS['buy_tinn_add']) {
$cart->add_cart($HTTP_GET_VARS['buy_tinn_add'],  $cart->get_quantity($HTTP_GET_VARS['buy_tinn_add']) +1);
}
if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .$HTTP_GET_VARS['products_id']));
} else {
$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id']) +1);
}
} elseif (BUY_TWO_DISCOUNT_BUNDLE =='discount') {
$bundle_products_id = tep_set_bundle($HTTP_GET_VARS['products_id'],$HTTP_GET_VARS['buy_tinn_add'],BUY_TWO_BUNDLE_DISCOUNT_RATE_A,BUY_TWO_BUNDLE_DISCOUNT_RATE_B);
$cart->add_cart($bundle_products_id, $cart->get_quantity($bundle_products_id) +1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
}
 }
// include the who's online functions
 require(DIR_WS_FUNCTIONS . 'whos_online.php');
 tep_update_whos_online();

// include the password crypto functions
 require(DIR_WS_FUNCTIONS . 'password_funcs.php');

// include validation functions (right now only email address)
 require(DIR_WS_FUNCTIONS . 'validations.php');

// split-page-results
 require(DIR_WS_CLASSES . 'split_page_results.php');

// infobox
 require(DIR_WS_CLASSES . 'boxes.php');

// auto activate and expire banners
 require(DIR_WS_FUNCTIONS . 'banner.php');
 tep_activate_banners();
 tep_expire_banners();

// auto expire special products
 require(DIR_WS_FUNCTIONS . 'specials.php');
 tep_expire_specials();

// auto expire featured products
 require(DIR_WS_FUNCTIONS . 'featured.php');
 tep_expire_featured();

// calculate category path
 if (isset($HTTP_GET_VARS['cPath'])) {
$cPath = $HTTP_GET_VARS['cPath'];
 } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
 } else {
$cPath = '';
 }

 if (tep_not_null($cPath)) {
$cPath_array = tep_parse_category_path($cPath);
$cPath = implode('_', $cPath_array);
$current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
 } else {
$current_category_id = 0;
 }

// include the breadcrumb class and start the breadcrumb trail
 require(DIR_WS_CLASSES . 'breadcrumb.php');
 $breadcrumb = new breadcrumb;

 $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

// add category names or the manufacturer name to the breadcrumb trail
 if (isset($cPath_array)) {
for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
  $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
  if (tep_db_num_rows($categories_query) > 0) {
	$categories = tep_db_fetch_array($categories_query);
	$breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
  } else {
	break;
  }
}
 } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
$manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
if (tep_db_num_rows($manufacturers_query)) {
  $manufacturers = tep_db_fetch_array($manufacturers_query);
  $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
}
 }

// add the products model to the breadcrumb trail
 if (isset($HTTP_GET_VARS['products_id'])) {
$model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
if (tep_db_num_rows($model_query)) {
  $model = tep_db_fetch_array($model_query);
  $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
}
 }

// include the articles functions
 require(DIR_WS_FUNCTIONS . 'articles.php');
 require(DIR_WS_FUNCTIONS . 'article_header_tags.php'); 

// calculate topic path
 if (isset($HTTP_GET_VARS['tPath'])) {
$tPath = $HTTP_GET_VARS['tPath'];
 } elseif (isset($HTTP_GET_VARS['articles_id']) && !isset($HTTP_GET_VARS['authors_id'])) {
$tPath = tep_get_article_path($HTTP_GET_VARS['articles_id']);
 } else {
$tPath = '';
 }

 if (tep_not_null($tPath)) {
$tPath_array = tep_parse_topic_path($tPath);
$tPath = implode('_', $tPath_array);
$current_topic_id = $tPath_array[(sizeof($tPath_array)-1)];
 } else {
$current_topic_id = 0;
 }

// add topic names or the author name to the breadcrumb trail
 if (isset($tPath_array)) {
for ($i=0, $n=sizeof($tPath_array); $i<$n; $i++) {
  $topics_query = tep_db_query("select topics_name from " . TABLE_TOPICS_DESCRIPTION . " where topics_id = '" . (int)$tPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
  if (tep_db_num_rows($topics_query) > 0) {
	$topics = tep_db_fetch_array($topics_query);
	$breadcrumb->add($topics['topics_name'], tep_href_link(FILENAME_ARTICLES, 'tPath=' . implode('_', array_slice($tPath_array, 0, ($i+1)))));
  } else {
	break;
  }
}
 } elseif (isset($HTTP_GET_VARS['authors_id'])) {
$authors_query = tep_db_query("select authors_name from " . TABLE_AUTHORS . " where authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'");
if (tep_db_num_rows($authors_query)) {
  $authors = tep_db_fetch_array($authors_query);
  $breadcrumb->add('Articles by ' . $authors['authors_name'], tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $HTTP_GET_VARS['authors_id']));
}
 }

// add the articles name to the breadcrumb trail
 if (isset($HTTP_GET_VARS['articles_id'])) {
$article_query = tep_db_query("select articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'");
if (tep_db_num_rows($article_query)) {
  $article = tep_db_fetch_array($article_query);
  if (isset($HTTP_GET_VARS['authors_id'])) {
	$breadcrumb->add($article['articles_name'], tep_href_link(FILENAME_ARTICLE_INFO, 'authors_id=' . $HTTP_GET_VARS['authors_id'] . '&articles_id=' . $HTTP_GET_VARS['articles_id']));
  } else {
	$breadcrumb->add($article['articles_name'], tep_href_link(FILENAME_ARTICLE_INFO, 'tPath=' . $tPath . '&articles_id=' . $HTTP_GET_VARS['articles_id']));
  }
}
 }


// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

// set which precautions should be checked
 define('WARN_INSTALL_EXISTENCE', 'true');
 define('WARN_CONFIG_WRITEABLE', 'true');
 define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
 define('WARN_SESSION_AUTO_START', 'true');
 define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');

 // START STS PLUS 4.0
 require (DIR_WS_CLASSES.'sts.php');
 $sts= new sts();
 $sts->start_capture();

// BOF: WebMakers.com Added: Header Tags Controller v2.5.7
 require(DIR_WS_FUNCTIONS . 'header_tags.php');
// Clean out HTML comments from ALT tags etc.
 require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');
// EOF: WebMakers.com Added: Header Tags Controller v2.5.7

include('application_top_support.php');

// Ad Tracker Begin - ADDED BY BENI
//user_tracking modications
 if (!$referer_url) {
  if ($HTTP_SERVER_VARS['HTTP_REFERER']) {
$referer_url = $HTTP_SERVER_VARS['HTTP_REFERER'];
session_register('referer_url'); 
//	tep_session_register('referer_url'); DID NOT WORK
}
 }

//user_ad_tracker modification
 if ($ad) {
  $advertiser = $_GET["ad"];  
  session_register('advertiser'); 
//	  tep_session_register('advertiser'); DID NOT WORK
  } 
// Ad Tracker End - ADDED BY BENI

// Include OSC-AFFILIATE
 require(DIR_WS_INCLUDES . 'affiliate_application_top.php');

require(DIR_WS_INCLUDES . 'add_ccgvdc_application_top.php');  // CCGV

?>

Edited by roggaboy

Share this post


Link to post
Share on other sites
Hi,

 

I had a problem with the above contributions and I sincerely hope that anyone can help me. I installed the product attributes option type feature and wishlist contributions. They all work fine except that when I log-in as a member to add a product into the wishlist, the attributes with text are not show in the wishlist and not showing in the shopping cart if you move the product from wishlist. Product attributes with drop down selection are shown correctly but not for text option and text area option.

 

 

Hello everyone, I do not know if this has been resolved, but I am having the same problem as this guy.

 

I am getting everything but the switch for the text_field and text boxes, the code I have for Wishlist 3.5 still does not allow for text attibutes to show up. I get the select box, check boxes etc.

 

The input looks like this:

 

<td class="main"><input name="id[txt_5]" size="30" maxlength="30" value="" type="text">  </td>
		</tr>

		<tr>
		  <td class="main">Gift Certificate Message</td>
		  <td class="main"><select name="id[9]"><option value="6">Best Wishes</option><option value="12">Congratulations</option><option value="15">Get Well Soon</option><option value="13">Good Luck</option><option value="11">Happy Anniversary</option><option value="10">Happy Birthday</option><option value="18">Happy Mother's Day</option><option value="19">Happy Valentine's Day</option><option value="16">Merry Christmas</option><option value="14">I Love You</option></select></td>

		</tr>
<!-- DDB - 041031 - Form Field Progress Bar //-->
		<tr>
		  <td class="main">Name(s)<br>(Add Your Name(s) Here)</td>
		  <td class="main"><textarea onkeydown="textCounter(this,'progressbar2',100)" onkeyup="textCounter(this,'progressbar2',100)" onfocus="textCounter(this,'progressbar2',100)" name="id[txt_2]" rows="5" id="id[txt_2]"></textarea>
					<div style="width: 0px;" id="progressbar2" class="progress">Limit: 0%</div>
					<script>textCounter(document.getElementById("id[txt_2]"),"progressbar2",100)</script></td>

		</tr>
<tr><td class="main">Please Email My Certificate: <br></td><td class="main"><input name="id[10]" value="0" type="checkbox"></td></tr><tr><td class="main">Please Mail My Certificate: <br></td><td class="main"><input name="id[4]" value="0" type="checkbox"></td></tr>

 

If you Enter the information the output you see is this:

 

Gift Certificate $25.00
:
Gift Certificate Message: Best Wishes
:
Please Email My Certificate: TEXT
Please Mail My Certificate: TEXT

 

I have been doing my best to figure out where the problem is originating, and my best guess is that it is something to do with this additional code in shopping_cart.php that is not in wishlist.php

 

		  //clr 030714 determine if attribute is a text attribute and assign to $attr_value temporarily
	  if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID) {
		echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']',  $products[$i]['attributes_values'][$option]);
		$attr_value = $products[$i]['attributes_values'][$option];
		//print(PRODUCTS_OPTIONS_VALUE_TEXT_ID);
		//print($attr_value .': <br />');
	  } else {
		echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
		$attr_value = $attributes_values['products_options_values_name'];
		//print(PRODUCTS_OPTIONS_VALUE_TEXT_ID);
		//print($attr_value .': <br />');
	  }

	 $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'] .': ';
	 $products[$i][$option]['options_values_id'] = $value;
	  //clr 030714 assign $attr_value
	  $products[$i][$option]['products_options_values_name'] = $attr_value;
	  //$products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
	 // $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];

 

But, because the process in shopping_cart.php is different for displaying the results (ie an infobox array) I can't for the life of me figure out how to modify the existing code!

 

Any help would be greatly appreciated!


Nothing unreal exists

Share this post


Link to post
Share on other sites

I have added the 1054 fix but now no matter what product i look at it automatically says "PRODUCT_ADDED_TO_WISHLIST" but it actually doesn't. When i try to add it it always tells me that the item is no longer available.

 

Any ideas?????

Share this post


Link to post
Share on other sites

Hey,

Great looking contribution. I just installed 3.5d (osCommerce MS2 - Wishlist) and when I click add to wishlist it simply adds the product to my shopping cart. After going to wishlist.php it says no items in wishlist. Anyone else have this problem or know of a fix to this issue? I checked the database and it has not added the product there either.

 

Thanks for any help.

Share this post


Link to post
Share on other sites

Oh yeah - after what a few months and no reply, I figured it out on my own. Good luck everyone.


Nothing unreal exists

Share this post


Link to post
Share on other sites
Hi,

 

Thanks for your help, it is now working. For anyone still struggling with it, here is the code from my product_info.php:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
		<td class="main"><a href="<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS, substr(tep_get_all_get_params(), 0, -1)); ?>"><?php echo tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS); ?></a>
</td>
		<td align="right" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></form></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<!-- wishlist mod added 02/12/03 -->		 


			<td align="right" class="main">
<?php
echo tep_draw_form('wishlist_quantity', tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist')); ?> 

<?php 
if (tep_session_is_registered('customer_id')) 
echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST); ?>


			</td> </form>


<!-- end wishlist mod added 02/12/03 -->
	  </tr>
	</table>

Only problem I'm having now is that the email is plain text, and all on one line (no carriage returns), but I'll see if I can do anything with that!

 

Claire

 

Hi

 

Thanks for the code. Is there any way of making this a text link rather then a button link? Seems like it is very close to being one.

 

thanks

Edited by navyhost

Sincerely

Mike

Share this post


Link to post
Share on other sites

hi all.

 

just added wishlist 3.5 to the shop to see how it worked, and i like it, but i have some questions now.

 

is it possible to remove the email and comments section from the list by entering 0 for the number of emails to display. at the moment if you enter 0 for the number of emails in the admin section it kicks out an error. it would make things tidier for the next question.

 

is it possible to have other people see the wishlist on the site (but not modify it).

instead of emailing the list to people, is it posible to have the wishlist viewable by people so that the creator of the list can just tell people where to go to view the list. this saves having to get emails for everyone, and if people get invited to a party or such after the list is first created and sent out, the creator of the list wont need to re email it to the new guest, but just tell them where to go, and the name to enter to view (and purchase from) the list.

 

to go with this, could the person viewing the wishlist add an item to there cart, pay for it, and have it shipped to the wishlist owner, and then removed from the list so that once the item had been purchased a duplicate could not be purchased by someone else.?

 

this would be a great addition to this mod, but my php skills (or lack of) prevent me from being able to code this.

would anyone like to try??

 

if anyone can suggest ways this could be done, or modify this mod to perform the above, or know of a mod that already works like this, it would help me out no end.

 

many thanks.

Share this post


Link to post
Share on other sites

I've just installed it v3.5 and added a link to account.php when I try to clcik it I get this error message:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/topgoth/public_html/includes/header.php:210) in /home/topgoth/public_html/includes/boxes/categories.php on line 13

 

Does anyone recognise the error? What should I do?

Edited by Benjjj6

Share this post


Link to post
Share on other sites

I tried to install this contri but can't get it to work. I checked the install information over and over again but it doensn't seem like I made a mistake.

When I try to put something on the wishlist( by clicking the add button), it goes to the wishlist and it doesn't show a product. It seems like the product isn't written to the database.

I checked the database but the table wishlist and wishlist attributes are there.

The only thing that looked strange to me is that the table wishlist didn't have a index defined. Is that good or can that be the problem?

 

Hope someone can help me out.

 

Kind regards,

Eppie

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×