Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wishlist 3.0 Support Thread


dblake

Recommended Posts

Installed this last night on my clients site and it works perfectly apart from when a logged in customer emails the wishlist to someone. When you click on the link in the email to view the wishlist, the wishlist shows and you can view items, but if you start to try to use the menu on the site, the menu doesn't display properly it just shows the block colours, the text only shows when you hover over the button, this only occurs via wishlist_public.php?

 

Could upload the screen grab, but you should be able to view it here: http://picasaweb.google.com/lh/photo/Lw_1FK4sDtl5iZqhiVJPzQ

 

I'm using the css menu contribution found here: http://www.oscommerce.com/community/contributions,4589

Link to comment
Share on other sites

I've got wishlist installed and it appears to be working perfectly, except emails are not being sent out when I try to test it.

 

There's no error, it claims it was successful, but nothing's showing up in my inbox.

 

I verified it's not the email server in general by sending an email to my test account from admin. Email in general is working.

 

Anyone else have a similar problem/know what the problem is?

Link to comment
Share on other sites

  • 3 weeks later...

I'm getting an error when I try to send my wishlist to someone. It says wishlist sent, but gives this error and the email never shows up.

 

Warning: Invalid argument supplied for foreach() in /hsphere/local/home/kikicann/pumpkinsboutique.com/catalog/wishlist.php on line 132

 

Warning: Invalid argument supplied for foreach() in /hsphere/local/home/kikicann/pumpkinsboutique.com/catalog/wishlist.php on line 160

 

I saw earlier in the thread where someone said they had to change some code to add some returns, I looked and that is not my problem.

 

Here is what is in my wishlist.php file. Can anyone help please? Thanks.

(line 132=$z = 0;)

(line 160=$error = true;)

 

<?php
/*
 $Id: wishlist.php,v 3.0  2005/04/20 Dennis Blake
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Released under the GNU General Public License
*/
// This version, removes the product when adding to a cart now, replaced all of the  HTTP_POST_VARS for $_POST

 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WISHLIST);

/*******************************************************************
******* ADD PRODUCT TO WISHLIST IF PRODUCT ID IS REGISTERED ********
*******************************************************************/

 if(tep_session_is_registered('wishlist_id')) {
$wishList->add_wishlist($wishlist_id, $attributes_id);
/*******************************************************************
******* CREATES COOKIE TO STORE WISHLIST ON LOCAL COMPUTER  ********
********************************************************************
******* TO CHANGE THE LENGTH OF TIME THE COOKIE IS STORED:  ********
*******                                                     ********
******* EDIT THE "DAYS" VARIABLE BELOW.  THIS VARIABLE IS   ********
******* THE NUMBER OF DAYS THE COOKIE IS STORED.            ********
*******************************************************************/	
//	$days = 30;																															
//	$time = time() + (3600 * 24 * $days);
// 	$cook_id = serialize($wishList->wishID);
//	tep_setcookie('wish', $cook_id , $time);
/***********************END CHANGE*********************************/

if(WISHLIST_REDIRECT == 'Yes') {
	tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id));
} else {
	tep_session_unregister('wishlist_id');
}
 }


/*******************************************************************
****************** ADD PRODUCT TO SHOPPING CART ********************
*******************************************************************/

 if (isset($_POST['add_wishprod'])) {
if(isset($_POST['add_prod_x'])) {
	foreach ($_POST['add_wishprod'] as $value) {
		$product_id = tep_get_prid($value);
		$cart->add_cart($product_id, $cart->get_quantity(tep_get_uprid($product_id, $_POST['id'][$value]))+1, $_POST['id'][$value]);
		$wishList->remove($value);
		}
	}
}



/*******************************************************************
****************** DELETE PRODUCT FROM WISHLIST ********************
*******************************************************************/

 if (isset($_POST['add_wishprod'])) {
if(isset($_POST['delete_prod_x'])) {
	foreach ($_POST['add_wishprod'] as $value) {
		$wishList->remove($value);
	}
}
 }


/*******************************************************************
************* EMAIL THE WISHLIST TO MULTIPLE FRIENDS ***************
*******************************************************************/

 if (isset($_POST['email_prod_x'])) {

	$errors = false;
	$guest_errors = "";
	$email_errors = "";
	$message_error = "";

	if(strlen($_POST['message']) < '1') {
		$error = true;
		$message_error .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_MESSAGE . "</div>";
	}			

 		if(tep_session_is_registered('customer_id')) {
		$customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
  		$customer = tep_db_fetch_array($customer_query);

		$from_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
		$from_email = $customer['customers_email_address'];
		$subject = $customer['customers_firstname'] . ' ' . WISHLIST_EMAIL_SUBJECT;
		$link = HTTP_SERVER . DIR_WS_CATALOG . FILENAME_WISHLIST_PUBLIC . "?public_id=" . $customer_id;

	//REPLACE VARIABLES FROM DEFINE
		$arr1 = array('$from_name', '$link');
		$arr2 = array($from_name, $link);
		$replace = str_replace($arr1, $arr2, WISHLIST_EMAIL_LINK);
		$message = tep_db_prepare_input($_POST['message']);
		$body = $message . $replace;
	} else {
		if(strlen($_POST['your_name']) < '1') {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_YOUR_NAME . "</div>";
		}
		if(strlen($_POST['your_email']) < '1') {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " .ERROR_YOUR_EMAIL . "</div>";
		} elseif(!tep_validate_email($_POST['your_email'])) {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_VALID_EMAIL . "</div>";
		}

		$from_name = stripslashes($_POST['your_name']);
		$from_email = $_POST['your_email'];
		$subject = $from_name . ' ' . WISHLIST_EMAIL_SUBJECT;
		$message = stripslashes($_POST['message']);

		$z = 0;
		$prods = "";
		foreach($_POST['prod_name'] as $name) {
			$prods .= stripslashes($name) . "  " . stripslashes($_POST['prod_att'][$z]) . "\n" . $_POST['prod_link'][$z] . "\n\n";
			$z++;
		}
		$body = $message . "\n\n" . $prods . "\n\n" . WISHLIST_EMAIL_GUEST;
  	}

	//Check each posted name => email for errors.
	$j = 0;
     $email = $_POST['email'];
	foreach($_POST['friend'] as $friendx) {
		if($j == 0) {
			if($friend[0] == '' && $email[0] == '') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ONE_EMAIL . "</div>";
			}
		}

		if(isset($friendx) && $friendx != '') {
			if(strlen($email[$j]) < '1') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ENTER_EMAIL . "</div>";
			} elseif(!tep_validate_email($email[$j])) {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_VALID_EMAIL . "</div>";
			}
		}

		if(isset($email[$j]) && $email[$j] != '') {
			if(strlen($friendx) < '1') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ENTER_NAME . "</div>";
			}
		}
		$j++;
	}
	if($error == false) {
		$j = 0;
		foreach($_POST['friend'] as $friendx) {
			if($friendx != '') {
				tep_mail($friendx, $email[$j], $subject, $friendx . ",\n\n" . $body, $from_name, $from_email);
			}

		//Clear Values
			$friend[$j] = "";
			$email[$j] = "";
			$message = "";

			$j++;
		}

       	$messageStack->add('wishlist', WISHLIST_SENT, 'success');
	}
 }


$breadcrumb->add(NAVBAR_TITLE_WISHLIST, tep_href_link(FILENAME_WISHLIST, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top">
  <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
     </table>
</td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('wishlist_form', tep_href_link(FILENAME_WISHLIST)); ?>
  <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td>
	  <table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" colspan="3"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_wishlist.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
         </table>
	</td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

<?php
 if ($messageStack->size('wishlist') > 0) {
?>
     <tr>
       <td><?php echo $messageStack->output('wishlist'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }


if (is_array($wishList->wishID) && !empty($wishList->wishID)) {
reset($wishList->wishID);

?>
  <tr>
	<td>
	<table border="0" width="100%" cellspacing="0" cellpadding="3" class="productListing">
	  <tr>
			<td class="productListing-heading"><?php echo BOX_TEXT_IMAGE; ?></td>
			<td class="productListing-heading"><?php echo BOX_TEXT_PRODUCT; ?></td>
			<td class="productListing-heading"><?php echo BOX_TEXT_PRICE; ?></td>
			<td class="productListing-heading" align="center"><?php echo BOX_TEXT_SELECT; ?></td>
	  </tr>

<?php
	$i = 0;
	while (list($wishlist_id, ) = each($wishList->wishID)) {

		$product_id = tep_get_prid($wishlist_id);

	    $products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.products_status, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ( " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where pd.products_id = '" . $product_id . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
		$products = tep_db_fetch_array($products_query);

	      if (($i/2) == floor($i/2)) {
	        $class = "productListing-even";
	      } else {
	        $class = "productListing-odd";
	      }

?>
			  <tr class="<?php echo $class; ?>">
				<td valign="top" class="productListing-data" align="left"><?php if($products['products_status'] == 0) {
			   			 echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); 
			   			}
                           else
                           {
						?>
			   <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>"><?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></a>
                  <?php } ?>

				<td valign="top" class="productListing-data" align="left" class="main"><b><?php if($products['products_status'] == 0) {
				echo $products['products_name']; 
				}
				else {
				?>
                   <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>"><?php echo $products['products_name']; ?></a>
                   <?php } ?></b>
				<input type="hidden" name="prod_link[]" value="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>" />
				<input type="hidden" name="prod_name[]" value="<?php echo $products['products_name']; ?>" />
<?php



/*******************************************************************
******** THIS IS THE WISHLIST CODE FOR PRODUCT ATTRIBUTES  *********
*******************************************************************/

                 $attributes_addon_price = 0;

                 // Now get and populate product attributes
				$att_name = "";
				if (isset($wishList->wishID[$wishlist_id]['attributes'])) {
					while (list($option, $value) = each($wishList->wishID[$wishlist_id]['attributes'])) {
                     		echo tep_draw_hidden_field('id[' . $wishlist_id . '][' . $option . ']', $value);

        					$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                                     from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                     where pa.products_id = '" . $wishlist_id . "'
                                      and pa.options_id = '" . $option . "'
                                      and pa.options_id = popt.products_options_id
                                      and pa.options_values_id = '" . $value . "'
                                      and pa.options_values_id = poval.products_options_values_id
                                      and popt.language_id = '" . $languages_id . "'
                                      and poval.language_id = '" . $languages_id . "'");
						$attributes_values = tep_db_fetch_array($attributes);

                      		if ($attributes_values['price_prefix'] == '+') {
							$attributes_addon_price += $attributes_values['options_values_price'];
                      		} else if($attributes_values['price_prefix'] == '-') {
                        		$attributes_addon_price -= $attributes_values['options_values_price'];
						}
						$att_name .= " (" . $attributes_values['products_options_name'] . ": " . $attributes_values['products_options_values_name'] . ") ";
                      		echo '<br /><small><i> ' . $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] . '</i></small>';
                   	} // end while attributes for product

				}

				echo '<input type="hidden" name="prod_att[]" value="' . $att_name . '" />';

                  	if (tep_not_null($products['specials_new_products_price'])) {
                  		$products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>';
                  	} else {
                      	$products_price = $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id']));
                   }

/*******************************************************************
******* CHECK TO SEE IF PRODUCT HAS BEEN ADDED TO THEIR CART *******
*******************************************************************/

		if($cart->in_cart($wishlist_id)) {
			echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_IN_CART . '</b></font>';
		}

/*******************************************************************
********** CHECK TO SEE IF PRODUCT IS NO LONGER AVAILABLE **********
*******************************************************************/

  			if($products['products_status'] == 0) {
  				echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_NOT_AVAILABLE . '</b></font>';
 			}

		$i++;
?>
		</td>
		<td valign="top" class="productListing-data"><?php echo $products_price; ?></td>
		<td valign="top" class="productListing-data" align="center">
<?php

/*******************************************************************
* PREVENT THE ITEM FROM BEING ADDED TO CART IF NO LONGER AVAILABLE *
*******************************************************************/

		if($products['products_status'] != 0) {
			echo tep_draw_checkbox_field('add_wishprod[]',$wishlist_id);
		}
?>
		</td>
	  </tr>

<?php
	}
?>
	</table>
	</td>
  </tr>
  <tr>
	<td align="right"><br /><?php echo tep_image_submit('button_delete.gif', 'Delete From Wishlist', 'name="delete_prod" value="delete_prod"') . " " . tep_image_submit('button_in_cart.gif', 'Add to Cart', 'name="add_prod" value="add_prod"'); ?></td>
	  </tr>
</table>
<?php

/*******************************************************************
*********** CODE TO SPECIFY HOW MANY EMAILS TO DISPLAY *************
*******************************************************************/


if(!tep_session_is_registered('customer_id')) {

?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <tr>
	<td class="main"><?php echo WISHLIST_EMAIL_TEXT_GUEST; ?></td>
  </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <tr>
       <td align="center">
		<table border="0" width="400px" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main" colspan="2"><table cellpadding="2" cellspacing="0">
			  <tr>
				<td colspan="2"><?php echo $guest_errors; ?></td>
			  </tr>
			  <tr>
				<td class="main"><?php echo TEXT_YOUR_NAME; ?></td>
				<td class="main"><?php echo tep_draw_input_field('your_name', $your_name); ?></td>
		  	  </tr>
		  	  <tr>
				<td class="main"><?php echo TEXT_YOUR_EMAIL; ?></td>
				<td class="main"><?php echo tep_draw_input_field('your_email', $your_email); ?></td>
		  	  </tr>
			</table></td>
		  </tr>
	      <tr>
	        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	      </tr>
	      <tr>
	        <td colspan="2"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
	      </tr>
	      <tr>
	        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	      </tr>
<?php 

} else {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <tr>
	<td class="main"><?php echo WISHLIST_EMAIL_TEXT; ?></td>
  </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <tr>
       <td align="center">
		<table border="0" width="400px" cellspacing="0" cellpadding="2">

<?php

}

?>
		  <tr>
			<td colspan="2"><?php echo $email_errors; ?></td>
		  </tr>
<?php

$email_counter = 0;
while($email_counter < DISPLAY_WISHLIST_EMAILS) {
?>
		  <tr>
			<td class="main"><?php echo TEXT_NAME; ?>  <?php echo tep_draw_input_field('friend[]', $friend[$email_counter]); ?></td>
			<td class="main"><?php echo TEXT_EMAIL; ?>  <?php echo tep_draw_input_field('email[]', $email[$email_counter]); ?></td>
		  </tr>
<?php
$email_counter++;
}
?>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo $message_error; ?></td>
		  </tr>
		  <tr>
			<td colspan="2" class="main"><?php echo TEXT_MESSAGE .  tep_draw_textarea_field('message', 'soft', 45, 5); ?></td>
		  </tr>
		  <tr>
			<td colspan="2" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE, 'name="email_prod" value="email_prod"'); ?></td>

		  </tr>
		</table>
	</td>
  </tr>
</table>
</form>
<?php

} else { // Nothing in the customers wishlist

?>
 <tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="main"><?php echo BOX_TEXT_NO_ITEMS;?></td>
	  </tr>
	</table>
	</td>
  </tr>
</table>
</td>
 </tr>
</table>
</form>

<?php 
}
?>
<!-- customer_wishlist_eof //-->
</td>

<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Edited by Jenica77
Link to comment
Share on other sites

I'm getting an error when I try to send my wishlist to someone. It says wishlist sent, but gives this error and the email never shows up.

 

 

 

I saw earlier in the thread where someone said they had to change some code to add some returns, I looked and that is not my problem.

 

Here is what is in my wishlist.php file. Can anyone help please? Thanks.

(line 132=$z = 0;)

(line 160=$error = true;)

 

<?php
/*
 $Id: wishlist.php,v 3.0  2005/04/20 Dennis Blake
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Released under the GNU General Public License
*/
// This version, removes the product when adding to a cart now, replaced all of the  HTTP_POST_VARS for $_POST

 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WISHLIST);

/*******************************************************************
******* ADD PRODUCT TO WISHLIST IF PRODUCT ID IS REGISTERED ********
*******************************************************************/

 if(tep_session_is_registered('wishlist_id')) {
$wishList->add_wishlist($wishlist_id, $attributes_id);
/*******************************************************************
******* CREATES COOKIE TO STORE WISHLIST ON LOCAL COMPUTER  ********
********************************************************************
******* TO CHANGE THE LENGTH OF TIME THE COOKIE IS STORED:  ********
*******                                                     ********
******* EDIT THE "DAYS" VARIABLE BELOW.  THIS VARIABLE IS   ********
******* THE NUMBER OF DAYS THE COOKIE IS STORED.            ********
*******************************************************************/	
//	$days = 30;																															
//	$time = time() + (3600 * 24 * $days);
// 	$cook_id = serialize($wishList->wishID);
//	tep_setcookie('wish', $cook_id , $time);
/***********************END CHANGE*********************************/

if(WISHLIST_REDIRECT == 'Yes') {
	tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id));
} else {
	tep_session_unregister('wishlist_id');
}
 }


/*******************************************************************
****************** ADD PRODUCT TO SHOPPING CART ********************
*******************************************************************/

 if (isset($_POST['add_wishprod'])) {
if(isset($_POST['add_prod_x'])) {
	foreach ($_POST['add_wishprod'] as $value) {
		$product_id = tep_get_prid($value);
		$cart->add_cart($product_id, $cart->get_quantity(tep_get_uprid($product_id, $_POST['id'][$value]))+1, $_POST['id'][$value]);
		$wishList->remove($value);
		}
	}
}



/*******************************************************************
****************** DELETE PRODUCT FROM WISHLIST ********************
*******************************************************************/

 if (isset($_POST['add_wishprod'])) {
if(isset($_POST['delete_prod_x'])) {
	foreach ($_POST['add_wishprod'] as $value) {
		$wishList->remove($value);
	}
}
 }


/*******************************************************************
************* EMAIL THE WISHLIST TO MULTIPLE FRIENDS ***************
*******************************************************************/

 if (isset($_POST['email_prod_x'])) {

	$errors = false;
	$guest_errors = "";
	$email_errors = "";
	$message_error = "";

	if(strlen($_POST['message']) < '1') {
		$error = true;
		$message_error .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_MESSAGE . "</div>";
	}			

 		if(tep_session_is_registered('customer_id')) {
		$customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
  		$customer = tep_db_fetch_array($customer_query);

		$from_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
		$from_email = $customer['customers_email_address'];
		$subject = $customer['customers_firstname'] . ' ' . WISHLIST_EMAIL_SUBJECT;
		$link = HTTP_SERVER . DIR_WS_CATALOG . FILENAME_WISHLIST_PUBLIC . "?public_id=" . $customer_id;

	//REPLACE VARIABLES FROM DEFINE
		$arr1 = array('$from_name', '$link');
		$arr2 = array($from_name, $link);
		$replace = str_replace($arr1, $arr2, WISHLIST_EMAIL_LINK);
		$message = tep_db_prepare_input($_POST['message']);
		$body = $message . $replace;
	} else {
		if(strlen($_POST['your_name']) < '1') {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_YOUR_NAME . "</div>";
		}
		if(strlen($_POST['your_email']) < '1') {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " .ERROR_YOUR_EMAIL . "</div>";
		} elseif(!tep_validate_email($_POST['your_email'])) {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_VALID_EMAIL . "</div>";
		}

		$from_name = stripslashes($_POST['your_name']);
		$from_email = $_POST['your_email'];
		$subject = $from_name . ' ' . WISHLIST_EMAIL_SUBJECT;
		$message = stripslashes($_POST['message']);

		$z = 0;
		$prods = "";
		foreach($_POST['prod_name'] as $name) {
			$prods .= stripslashes($name) . "  " . stripslashes($_POST['prod_att'][$z]) . "\n" . $_POST['prod_link'][$z] . "\n\n";
			$z++;
		}
		$body = $message . "\n\n" . $prods . "\n\n" . WISHLIST_EMAIL_GUEST;
  	}

	//Check each posted name => email for errors.
	$j = 0;
     $email = $_POST['email'];
	foreach($_POST['friend'] as $friendx) {
		if($j == 0) {
			if($friend[0] == '' && $email[0] == '') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ONE_EMAIL . "</div>";
			}
		}

		if(isset($friendx) && $friendx != '') {
			if(strlen($email[$j]) < '1') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ENTER_EMAIL . "</div>";
			} elseif(!tep_validate_email($email[$j])) {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_VALID_EMAIL . "</div>";
			}
		}

		if(isset($email[$j]) && $email[$j] != '') {
			if(strlen($friendx) < '1') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ENTER_NAME . "</div>";
			}
		}
		$j++;
	}
	if($error == false) {
		$j = 0;
		foreach($_POST['friend'] as $friendx) {
			if($friendx != '') {
				tep_mail($friendx, $email[$j], $subject, $friendx . ",\n\n" . $body, $from_name, $from_email);
			}

		//Clear Values
			$friend[$j] = "";
			$email[$j] = "";
			$message = "";

			$j++;
		}

       	$messageStack->add('wishlist', WISHLIST_SENT, 'success');
	}
 }


$breadcrumb->add(NAVBAR_TITLE_WISHLIST, tep_href_link(FILENAME_WISHLIST, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top">
  <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
     </table>
</td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('wishlist_form', tep_href_link(FILENAME_WISHLIST)); ?>
  <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td>
	  <table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" colspan="3"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_wishlist.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
         </table>
	</td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

<?php
 if ($messageStack->size('wishlist') > 0) {
?>
     <tr>
       <td><?php echo $messageStack->output('wishlist'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }


if (is_array($wishList->wishID) && !empty($wishList->wishID)) {
reset($wishList->wishID);

?>
  <tr>
	<td>
	<table border="0" width="100%" cellspacing="0" cellpadding="3" class="productListing">
	  <tr>
			<td class="productListing-heading"><?php echo BOX_TEXT_IMAGE; ?></td>
			<td class="productListing-heading"><?php echo BOX_TEXT_PRODUCT; ?></td>
			<td class="productListing-heading"><?php echo BOX_TEXT_PRICE; ?></td>
			<td class="productListing-heading" align="center"><?php echo BOX_TEXT_SELECT; ?></td>
	  </tr>

<?php
	$i = 0;
	while (list($wishlist_id, ) = each($wishList->wishID)) {

		$product_id = tep_get_prid($wishlist_id);

	    $products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.products_status, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ( " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where pd.products_id = '" . $product_id . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
		$products = tep_db_fetch_array($products_query);

	      if (($i/2) == floor($i/2)) {
	        $class = "productListing-even";
	      } else {
	        $class = "productListing-odd";
	      }

?>
			  <tr class="<?php echo $class; ?>">
				<td valign="top" class="productListing-data" align="left"><?php if($products['products_status'] == 0) {
			   			 echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); 
			   			}
                           else
                           {
						?>
			   <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>"><?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></a>
                  <?php } ?>

				<td valign="top" class="productListing-data" align="left" class="main"><b><?php if($products['products_status'] == 0) {
				echo $products['products_name']; 
				}
				else {
				?>
                   <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>"><?php echo $products['products_name']; ?></a>
                   <?php } ?></b>
				<input type="hidden" name="prod_link[]" value="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>" />
				<input type="hidden" name="prod_name[]" value="<?php echo $products['products_name']; ?>" />
<?php



/*******************************************************************
******** THIS IS THE WISHLIST CODE FOR PRODUCT ATTRIBUTES  *********
*******************************************************************/

                 $attributes_addon_price = 0;

                 // Now get and populate product attributes
				$att_name = "";
				if (isset($wishList->wishID[$wishlist_id]['attributes'])) {
					while (list($option, $value) = each($wishList->wishID[$wishlist_id]['attributes'])) {
                     		echo tep_draw_hidden_field('id[' . $wishlist_id . '][' . $option . ']', $value);

        					$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                                     from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                     where pa.products_id = '" . $wishlist_id . "'
                                      and pa.options_id = '" . $option . "'
                                      and pa.options_id = popt.products_options_id
                                      and pa.options_values_id = '" . $value . "'
                                      and pa.options_values_id = poval.products_options_values_id
                                      and popt.language_id = '" . $languages_id . "'
                                      and poval.language_id = '" . $languages_id . "'");
						$attributes_values = tep_db_fetch_array($attributes);

                      		if ($attributes_values['price_prefix'] == '+') {
							$attributes_addon_price += $attributes_values['options_values_price'];
                      		} else if($attributes_values['price_prefix'] == '-') {
                        		$attributes_addon_price -= $attributes_values['options_values_price'];
						}
						$att_name .= " (" . $attributes_values['products_options_name'] . ": " . $attributes_values['products_options_values_name'] . ") ";
                      		echo '<br /><small><i> ' . $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] . '</i></small>';
                   	} // end while attributes for product

				}

				echo '<input type="hidden" name="prod_att[]" value="' . $att_name . '" />';

                  	if (tep_not_null($products['specials_new_products_price'])) {
                  		$products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>';
                  	} else {
                      	$products_price = $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id']));
                   }

/*******************************************************************
******* CHECK TO SEE IF PRODUCT HAS BEEN ADDED TO THEIR CART *******
*******************************************************************/

		if($cart->in_cart($wishlist_id)) {
			echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_IN_CART . '</b></font>';
		}

/*******************************************************************
********** CHECK TO SEE IF PRODUCT IS NO LONGER AVAILABLE **********
*******************************************************************/

  			if($products['products_status'] == 0) {
  				echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_NOT_AVAILABLE . '</b></font>';
 			}

		$i++;
?>
		</td>
		<td valign="top" class="productListing-data"><?php echo $products_price; ?></td>
		<td valign="top" class="productListing-data" align="center">
<?php

/*******************************************************************
* PREVENT THE ITEM FROM BEING ADDED TO CART IF NO LONGER AVAILABLE *
*******************************************************************/

		if($products['products_status'] != 0) {
			echo tep_draw_checkbox_field('add_wishprod[]',$wishlist_id);
		}
?>
		</td>
	  </tr>

<?php
	}
?>
	</table>
	</td>
  </tr>
  <tr>
	<td align="right"><br /><?php echo tep_image_submit('button_delete.gif', 'Delete From Wishlist', 'name="delete_prod" value="delete_prod"') . " " . tep_image_submit('button_in_cart.gif', 'Add to Cart', 'name="add_prod" value="add_prod"'); ?></td>
	  </tr>
</table>
<?php

/*******************************************************************
*********** CODE TO SPECIFY HOW MANY EMAILS TO DISPLAY *************
*******************************************************************/


if(!tep_session_is_registered('customer_id')) {

?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <tr>
	<td class="main"><?php echo WISHLIST_EMAIL_TEXT_GUEST; ?></td>
  </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <tr>
       <td align="center">
		<table border="0" width="400px" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main" colspan="2"><table cellpadding="2" cellspacing="0">
			  <tr>
				<td colspan="2"><?php echo $guest_errors; ?></td>
			  </tr>
			  <tr>
				<td class="main"><?php echo TEXT_YOUR_NAME; ?></td>
				<td class="main"><?php echo tep_draw_input_field('your_name', $your_name); ?></td>
		  	  </tr>
		  	  <tr>
				<td class="main"><?php echo TEXT_YOUR_EMAIL; ?></td>
				<td class="main"><?php echo tep_draw_input_field('your_email', $your_email); ?></td>
		  	  </tr>
			</table></td>
		  </tr>
	      <tr>
	        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	      </tr>
	      <tr>
	        <td colspan="2"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
	      </tr>
	      <tr>
	        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	      </tr>
<?php 

} else {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <tr>
	<td class="main"><?php echo WISHLIST_EMAIL_TEXT; ?></td>
  </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <tr>
       <td align="center">
		<table border="0" width="400px" cellspacing="0" cellpadding="2">

<?php

}

?>
		  <tr>
			<td colspan="2"><?php echo $email_errors; ?></td>
		  </tr>
<?php

$email_counter = 0;
while($email_counter < DISPLAY_WISHLIST_EMAILS) {
?>
		  <tr>
			<td class="main"><?php echo TEXT_NAME; ?>  <?php echo tep_draw_input_field('friend[]', $friend[$email_counter]); ?></td>
			<td class="main"><?php echo TEXT_EMAIL; ?>  <?php echo tep_draw_input_field('email[]', $email[$email_counter]); ?></td>
		  </tr>
<?php
$email_counter++;
}
?>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo $message_error; ?></td>
		  </tr>
		  <tr>
			<td colspan="2" class="main"><?php echo TEXT_MESSAGE .  tep_draw_textarea_field('message', 'soft', 45, 5); ?></td>
		  </tr>
		  <tr>
			<td colspan="2" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE, 'name="email_prod" value="email_prod"'); ?></td>

		  </tr>
		</table>
	</td>
  </tr>
</table>
</form>
<?php

} else { // Nothing in the customers wishlist

?>
 <tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="main"><?php echo BOX_TEXT_NO_ITEMS;?></td>
	  </tr>
	</table>
	</td>
  </tr>
</table>
</td>
 </tr>
</table>
</form>

<?php 
}
?>
<!-- customer_wishlist_eof //-->
</td>

<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Hi Jenica

 

see this post http://www.oscommerce.com/forums/topic/166244-wishlist-3-0-support-thread/page__view__findpost__p__729370

 

Steve

Link to comment
Share on other sites

I just installed this and it seemed to go fine except for it wont add anything to wishlist when you click on the button...its showing this beside the button on product page //wishlist //wishlist next to button..... and the column_right.php file looks nothing like the file that came with the wishlist contrib.... require(DIR_WS_BOXES . 'shopping_cart.php');

if($wishList->count_wishlist() != '0') {

require(DIR_WS_BOXES . 'wishlist.php');

}

 

There is no require(DIR_WS_BOXES . 'shopping_cart.php'); to add the wishlist code under it as shown above

I tried the file that came with the contrib but just get a call to member function for wishlist.php error

 

any ideas on how to fix this?

Link to comment
Share on other sites

 

I'm assuming you meant this post:

OK, for further reference, I found the prob. I had an error in the database upload, verified the DB and everything is ok now. Not to say that thats the case for every foreach error, but its a place to start !

 

I looked at the database and the only thing I can tell that might be wrong is that the customers_wishlist table has no index defined. I loaded the wishlist.sql that came with the add-on and it tells me that customers_wishlist already exists. Is there something else I should look at in that table? Thanks for your time.

Link to comment
Share on other sites

Has anyone gotten this to work with MULTIPLE lists?? So the client can create two wish-lists.. say a birthday list and an xmas list?

 

Or for my own use, I would be happy if I create TWO lists for them.. So when they log in they are given TWO lists and the product pages will have to buttons, add to list #1 and add to list #2

Edited by lindsayanng

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Has anyone gotten this to work with MULTIPLE lists?? So the client can create two wish-lists.. say a birthday list and an xmas list?

 

Or for my own use, I would be happy if I create TWO lists for them.. So when they log in they are given TWO lists and the product pages will have to buttons, add to list #1 and add to list #2

 

I have been thinking about this daily and may even give something like that a go when i have the time.

 

 

I would guess you would need another field/ table that links in wishlist_id.

 

mayeb another table wislist description, similar to categories and categories description.

 

then on the wish list files where you add or view a wish list, you need that function adding again it be similar to ading a new category I guess.

 

 

The problem is making it smart so theres little code/ database resources required to run it.

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

Yes, it COULD be as simple as creating multiple tables.. and yea, the hard part is the interface that allows the client to add them themselves - and the even MORE complex part would be the "add to list 1/2" on the product info page.

 

I mean, it doesn't mean much if you cant just add to the wishlist you want from the product info page.

 

It's something I would be willing to work on WITH someone or have someone "fund" this project

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

  • 2 weeks later...

FWIW -- in case anyone is trying to get wishlist and QT Pro working together, you've likely noticed that the attributes don't get added to the wishlist any longer after installing QT Pro. Here's what I did to resolve that for one particular site:

 

In Application top, find this:

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

and change it to this:

//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');
} else {
if(isset($HTTP_POST_VARS['attrcomb'])) {
//convert attrcomb to standard attrib format
$attrlist=explode(',',$HTTP_POST_VARS['attrcomb']);
foreach ($attrlist as $attr) {
	list($oid, $oval)=explode('-',$attr);
	if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
	$attributes_id[$oid]=$oval;
}
tep_session_register('attributes_id');
}
}
$wishlist_id = $HTTP_POST_VARS['products_id'];
tep_session_register('wishlist_id');
}
tep_redirect(tep_href_link(FILENAME_WISHLIST));
}

Link to comment
Share on other sites

Hey.. got another question with the wishlist addon. Again, i'm not using it as a typical wish list, but instead a way for people to add their favorite photos to a list to send to my husband (the store owner) so that he can include them in their wedding book.

 

So right now you can email your list to a friend, which is perfect because i want them to email their list to my husband.. but how do i set the form to automatically be pre-filled with my husband's email address?

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

My "Add to Cart" button on the wishlist page is not adding selected product to the cart.

im assuming this snippet of code (from catalog\wishlist.php) below is relevant.

 

 

<td align="right"><br /><?php echo tep_image_submit('button_delete.gif', 'Delete From Wishlist', 'name="delete_prod" value="delete_prod"') . " " . tep_image_submit('button_in_cart.gif', 'Add to Cart', 'name="add_prod" value="add_prod"'); ?></td>

 

any ideas why the add to cart button isnt working? the add to cart button functions elsewhere; in the product_info page for example.

 

btw, the delete button works on my wishlist page.

 

also this snippet may be relevant..?

 

/*******************************************************************
****************** ADD PRODUCT TO SHOPPING CART ********************
*******************************************************************/

 if (isset($_POST['add_wishprod'])) {
if(isset($_POST['add_prod_x'])) {
	foreach ($_POST['add_wishprod'] as $value) {
		$product_id = tep_get_prid($value);
		$cart->add_cart($product_id, $cart->get_quantity(tep_get_uprid($product_id, $_POST['id'][$value]))+1, $_POST['id'][$value]);
		$wishList->remove($value);
		}
	}
}

Edited by adamsleath
Link to comment
Share on other sites

sorry for the double post:

 

but i experimented with changing this:

 

tep_image_submit('button_in_cart.gif', 'Add to Cart', 'name="add_prod" value="add_prod"')

 

to this:

 

tep_image_submit('button_in_cart.gif', 'Add to Cart', 'name="add_prod_x" value="add_prod_x"')

the result being that when i click add to cart on the wishlist page, the item disappears from the wishlist, AND does get added to the shopping cart, which is quite satisfactory imo.

Edited by adamsleath
Link to comment
Share on other sites

  • 5 weeks later...

hey guys, I need some suggestions for altering this addon a little.

 

I want to know if there is a way, like with adding to a shopping cart, if you can add to wishlist and just have it show in the wishlist box without redirecting to the wishlist page. Any thoughts/ suggestions

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

  • 2 weeks later...

Did you ever get this resolved? I am having the same issue.. I am hosting with godaddy?..

 

 

I've got wishlist installed and it appears to be working perfectly, except emails are not being sent out when I try to test it.

 

There's no error, it claims it was successful, but nothing's showing up in my inbox.

 

I verified it's not the email server in general by sending an email to my test account from admin. Email in general is working.

 

Anyone else have a similar problem/know what the problem is?

Link to comment
Share on other sites

  • 3 months later...

Hi.

 

I have Wishlist 5.1 perfectly running. well, almost perfectly.

 

In Admin Section the "Max Wish List" (How many wish list items to show per page on the main wishlist.php file) does not work. I can limit it to 5 and still add hundreds of items to my wish list.

 

Though, I can limit the "Max Wish List Box" Dialogue as well as the number of emails to show and also the wishlist redirect (yes/no) works. The only thing that ist not working is the limitation of Wishlist Items.

 

I have installed it twice and everything looks to be just as it is supposed to.

 

Anyone out there with an idea ? Pls let me know if I should post whatever file.

 

THX

Tom

Link to comment
Share on other sites

Please call me a stupid b.... and disregard my first post! ;)

 

 

 

I just missunderstood the feature: "Max Wish List" and thought it would limit the maximum number of products to be wishlisted. ... and just realized that it is only ment to limit the number of products shown to a friend on public_wishlist.

 

The limitation of number of products possible to be wishlistet is obviously another problem.

 

wishlist is just working as it sould.

 

THX

Link to comment
Share on other sites

  • 3 weeks later...

Karen, I had the same issue but I've found a solution and it might help you.

 

If you have mod your osc with CSS Buttons then you need to do the followings:

 

Open html_output.php under includes/functions folder:

add the following code before the end of the document ?>

 

// Original tep_image_submit
// Outputs a button in the selected language
 function tep_image_submit_ori($image, $alt = '', $parameters = '') {
   global $language;

   $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

   if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

   if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

   $image_submit .= '>';

   return $image_submit;
 }

 

For each tep_image_submit you use for wishlist, you need to change it to tep_image_submit_ori.

 

for instance on your code:

 

<td align="center"><?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); ?></td>

change it to:

<td align="center"><?php echo tep_image_submit_ori('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); ?></td>

 

hope this helps.

 

Bru

 

 

I followed this advice to get my css buttons to work with wishlist, and it worked like a charm. However, can anyone explain the black rectangle around my button created to match the others? Any help would be appreciated.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

would you know how to modify this piece of code?

 

I would like to allow customers to move items from their shopping cart to their wishlist.

 

It seems that the old version of the contribution did that

 

http://addons.oscommerce.com/info/2581

+ remove items from shopping cart to wishlist [new!]

 

I guess the code that did that was:

app._top.php

 

case 'add_wishlist_from_cart' :
if (isset($HTTP_GET_VARS['pid'])) 
{

///////////////////////////////
  $cart->remove($HTTP_GET_VARS['pid']);  
//////////////////////////////								
$wishlist->add_cart($HTTP_GET_VARS['pid'], 
$wishlist->get_quantity(tep_get_uprid($HTTP_GET_VARS['pid'], $HTTP_GET_VARS['id']))+1, $HTTP_GET_VARS['id']);
//       $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);

}
break;

 

shopping_cart.php

// MY_WISHLIST	v1.0
 if (strstr($PHP_SELF, FILENAME_SHOPPING_CART)) {
echo '<td valign="top" class="main" align="right"><a href="' . tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_wishlist_from_cart' . '&pid='.$products[$i]['id']) . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a></td>'. "\n"; 
 } 
// MY_WISHLIST v1.0

 

But I can´t make it work. Would you know what to change please? Thank you :)

Link to comment
Share on other sites

  • 4 weeks later...

Here's another serious bug in wishlist I couldn't resolve but others have similar problems as well...

 

When a logged in user sends his wishlist to his own email address and then clicks to view his public wishlist,

the wishlist box breaks with a fatal error Call to a non object error. Additionally the wishlist is empty after that

but wir re-appear when the user logs out and in again.

 

I tried to reolve the bug in appplication_top.php but no success...

 

Here's my version of the wishlist in application_top.php:

// wishlist data
 if (tep_session_is_registered('wishlist') && is_object($wishlist)) {
   if (PHP_VERSION < 4) {
     $broken_wishlist = $wishlist;
     $wishlist = new wishlist;
     $wishlist->unserialize($broken_wishlist);
   }
 } else {
   tep_session_register('wishlist');
   $wishlist = new wishlist;
 }

 

Any ideas or at least the same error when you follow my description?

Link to comment
Share on other sites

  • 1 month later...

I followed this advice to get my css buttons to work with wishlist, and it worked like a charm. However, can anyone explain the black rectangle around my button created to match the others? Any help would be appreciated.

 

Okay I feel like an idiot because this took me weeks to figure out, and the solution was so simple - staring me right in the face. But I scoured the forums and couldn't find an answer, so I am posting it here.

 

To get rid of that annoying black border around your buttons, simply add style="border:0" to the end of this line of code. Once I figured this out, I was able to match the buttons on the wishlist page as well. Now everything looks seamless.

 

<td class="main"><?php echo tep_image_submit_ori('button_wishlist.gif' , 'Add to Wishlist', 'name="wishlist" value="wishlist" style="border:0"'); ?></td>

Link to comment
Share on other sites

Hi,

 

would you know how to modify this piece of code?

 

I would like to allow customers to move items from their shopping cart to their wishlist.

 

It seems that the old version of the contribution did that

 

http://addons.oscommerce.com/info/2581

+ remove items from shopping cart to wishlist [new!]

 

I guess the code that did that was:

app._top.php

 

case 'add_wishlist_from_cart' :
if (isset($HTTP_GET_VARS['pid'])) 
{

///////////////////////////////
  $cart->remove($HTTP_GET_VARS['pid']);  
//////////////////////////////								
$wishlist->add_cart($HTTP_GET_VARS['pid'], 
$wishlist->get_quantity(tep_get_uprid($HTTP_GET_VARS['pid'], $HTTP_GET_VARS['id']))+1, $HTTP_GET_VARS['id']);
//       $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);

}
break;

 

shopping_cart.php

// MY_WISHLIST	v1.0
 if (strstr($PHP_SELF, FILENAME_SHOPPING_CART)) {
echo '<td valign="top" class="main" align="right"><a href="' . tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_wishlist_from_cart' . '&pid='.$products[$i]['id']) . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a></td>'. "\n"; 
 } 
// MY_WISHLIST v1.0

 

But I can´t make it work. Would you know what to change please? Thank you :)

 

just a shot in the dark

Sometimes changing $HTTP_GET_VARS to $_GET has made things work

Link to comment
Share on other sites

  • 2 weeks later...

Hello!

 

I have wishlist v5 installed - it seems to work ok. The problem I have is if there are multiple items in the wishlist and you go to the wishlist reports it shows the customer name but only the last item thats on the wishlist - shouldn't there be the entire wishlist in the report for that customer?

 

Has anyone seen this ? is there a fix?

 

Thanks

Pete

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...