Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wishlist 3.0 Support Thread


dblake

Recommended Posts

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

 

Please disregard the items are listed - just didnt see them at first.

Link to comment
Share on other sites

  • 3 weeks later...

I installed this contribution on a test site over the holidays and while everything that I tested seems to be working fine I'm interested in knowing how others have set this up from a customers point of view...are you requiring customers to be login to use it? How have you explained it's use or otherwise promoted the feature. I'm interested in seeing what others have done as I slowly work this add-on into our site. Care to share how you have it installed?

 

Dan

Link to comment
Share on other sites

I've been integrating this contribution with our site and one of the things I noticed in reading the thread is that links weren't included in the emails. I thought that would be handy feature so I added a link to the guess emails. I don't think it'll work with attributes since I don't use them I couldn't play around with it, so if you use attributes you might need to mess with the code a wee bit...it is a very simple change really...here is what I did.

 

In catalog/wishlist.php find...

 

$prods .= stripslashes($name) . " " . stripslashes($_POST['prod_att'][$z]) . "\n" . $_POST['prod_link'][$z] . "\n\n";

 

Replace with...

 

$prods .= '<a href="' .$_POST['prod_link'][$z] . '">' . stripslashes($name) . " " . '</a>'. stripslashes($_POST['prod_att'][$z]) . "\n\n";

 

If anyone sorts out the link for attributes or if you found a better way to do this, please post it here.

 

Dan

Link to comment
Share on other sites

  • 1 month later...

Hello

 

i am getting an error when someone is longer in the shop about 40-50 minutes.

 

i have to close the browser completely otherwise the error does not go away

 

Fatal error: Call to a member function reset() on a non-object

 

I have changed the L to l

I've tried the navigation_history fix

and i remove the breadcrumb

 

but the error will not go away

Someone got an idea? Please :(

Link to comment
Share on other sites

I ma new to OsCommerce, I have installed this contribution. All seems to work well, except when I click on Wishlist it then adds to cart. I have edited the application_top.php as detailed.

 

Does anyone have a solution for this error?

Link to comment
Share on other sites

I ma new to OsCommerce, I have installed this contribution. All seems to work well, except when I click on Wishlist it then adds to cart. I have edited the application_top.php as detailed.

 

Does anyone have a solution for this error?

Check over the installation instructions again...I installed it recently and it does work.

 

I assume you're installing it to a 2.2 version of OSC?

 

Dan

 

PS: For the record, I installed Fimble's Full Package version.

Edited by Dan Cole
Link to comment
Share on other sites

Check over the installation instructions again...I installed it recently and it does work.

 

I assume you're installing it to a 2.2 version of OSC?

 

Dan

 

PS: For the record, I installed Fimble's Full Package version.

 

I have checked the application top many times, even used the backup to start afresh but still the same. My store version is V2.2.

 

I downloaded umar786 version, it looks like its the same. I will download Fimble version and try to instal that one instead and see if it works.

 

Thanks again for your respond.

Link to comment
Share on other sites

Check over the installation instructions again...I installed it recently and it does work.

 

I assume you're installing it to a 2.2 version of OSC?

 

Dan

 

PS: For the record, I installed Fimble's Full Package version.

 

Have installed everything fresh, but I still get the same problem. The product is added to the cart instead of wishlist.

 

Here is my application top code around where changes were needed.

 

First chancge:

 

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

 

// include wishlist class

require(DIR_WS_CLASSES . 'wishlist.php');

// include navigation history class

require(DIR_WS_CLASSES . 'navigation_history.php');

 

Second change:

 

// navigation history

if (tep_session_is_registered('navigation')) {

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

$navigation = new navigationHistory;

$navigation->unserialize($broken_navigation);

}

} else {

tep_session_register('navigation');

$navigation = new navigationHistory;

}

$navigation->add_current_page();

 

// wishlist data

if(!tep_session_is_registered('wishList')) {

tep_session_register('wishList');

$wishList = new wishlist;

}

 

//Wishlist actions (must be before shopping cart actions)

if(isset($HTTP_POST_VARS['wishlist_x'])) {

if(isset($HTTP_POST_VARS['products_id'])) {

if(isset($HTTP_POST_VARS['id'])) {

$attributes_id = $HTTP_POST_VARS['id'];

tep_session_register('attributes_id');

}

$wishlist_id = $HTTP_POST_VARS['products_id'];

tep_session_register('wishlist_id');

}

tep_redirect(tep_href_link(FILENAME_WISHLIST));

}

// Shopping cart actions

if (isset($HTTP_GET_VARS['action'])) {

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled

if ($session_started == false) {

tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));

}

 

if (DISPLAY_CART == 'true') {

$goto = FILENAME_SHOPPING_CART;

$parameters = array('action', 'cPath', 'products_id', 'pid');

} else {

$goto = basename($PHP_SELF);

if ($HTTP_GET_VARS['action'] == 'buy_now') {

$parameters = array('action', 'pid', 'products_id');

} else {

$parameters = array('action', 'pid');

 

Is the code correct?

Link to comment
Share on other sites

  • 1 month later...

Have installed everything fresh, but I still get the same problem. The product is added to the cart instead of wishlist.

 

Do you have the CSS buttons contribution installed? There are some posts in this thread reporting this kind of a problem when using that contribution...fortunately their is also a solution posted....if that sounds like your problem look back through the last couple of pages.

 

Dan

Link to comment
Share on other sites

  • 3 weeks later...

It works for me !! The addition i added above. It should be fine to use this addition even if QTPRO is not installed because...

 

if attrcomb is set (QTPro is installed) id will not be set

 

and

 

if id is set (QTPro is not installed) attrcomb will not be set.

 

Best Wishes

Alex

Dear Alex,

 

Thank you so much. It is working for me too.

Link to comment
Share on other sites

  • 7 months later...

Just took over helping an old friend with a website the other day. They have a 3.x (don't know exactly which one) wishlist added to their osc site.

 

They are having customer complaints because customer's wishlists are disappearing when they log back onto their accounts. Have their been any fixes allowing the wishlist to be repopulated from the site database, instead of cookies if the cookie no longer exists?

 

Any help would be appreciated,

 

Adam Kowalyk

Link to comment
Share on other sites

  • 1 year later...

I'm getting this notice...........

 

Notice: Undefined property: wishlist::$wishID in /home/mysite/public_html/includes/modules/boxes/bm_wishlist.php on line 37

 

Any idea what is it...?

A man is great by Deeds, not by Birth....

Link to comment
Share on other sites

  • 3 weeks later...

Hello!

 

I'm one error away from having this work having already worked through a pageful using the forum etc. The only solution I've found to the error below:

 

Notice Trying to get property of non-object in /shop/includes/modules/boxes/bm_wishlist.php on line 37

 

Warning: Cannot modify header information - headers already sent by (output started at /shop/includes/modules/boxes/bm_wishlist.php:37) in /shop/ext/tcpdf/tcpdf.php on line 7599 TCPDF ERROR: Some data has already been output to browser, can't send PDF file

 

is to change

 

 

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

reset($wishList->wishID);

$counter = count($wishList->wishID);

$wishlist_box = '';

if ($counter <= MAX_DISPLAY_WISHLIST_BOX) {

$wishlist_box = '<ul style="list-style:inside disc; padding: 0px;">';

 

to

 

 

if (is_array($wishList['wishID']) && !empty($wishList['wishID'])) {

reset($wishList->wishID);

$counter = count($wishList->wishID);

$wishlist_box = '';

if ($counter <= MAX_DISPLAY_WISHLIST_BOX) {

$wishlist_box = '<ul style="list-style:inside disc; padding: 0px;">';

 

This allows PDF datasheet to work BUT stops main screen displaying saying it can't find the array.

 

Can anyone point me in the right direction?

 

Thanks,

 

Lorraine

Link to comment
Share on other sites

Wish List Work Around:

 

Okay I've got this to work by un-installing the wishlist box and creating a new link to the Wish List in account.php

 

This allows PDF datasheet to work and maintains the Wish List function. The only drawback is no nice display as a box. Not a coder best I can do ....

 

Lorraine

Link to comment
Share on other sites

  • 9 months later...

Hi,

Does anyone know how to make the wishlist box appear only if there are items in the list? This would be for version 2.3.

In the older Oscommerce version the code was:

 

Edit catalog/includes/column_right.php

 

Find:

require(DIR_WS_BOXES . 'shopping_cart.php');

Below that code ADD this:

if($wishList->count_wishlist() != '0') { require(DIR_WS_BOXES . 'wishlist.php'); }

 

 

I would think that for the new version the code would go in bm_wishlist.php file.

 

Can anyone help?

 

Thanks in advance

Link to comment
Share on other sites

  • 5 months later...

Not sure if this is the correct support thread but i installed this Wishlist on my page:

 

http://addons.oscommerce.com/info/8665/v,23

 

Everything seems to work fine except when i am on the wishlist page, i dont seem to have the Email fields:

 

post-149860-0-59572400-1405752865_thumb.jpg

 

Only the My Email and My name is displayed.

 

Also, in the admin section, under configuration, this is what i see in the Wishlist tab:

 

post-149860-0-90599600-1405752697_thumb.png

 

This is my catalog/wishlist.php

<?php
/*
  $Id: wishlist.php,v 3.11  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*********************************/
    $product_id = $wishlist_id;
   	tep_session_unregister('wishlist_id');
  	if(tep_session_is_registered('attributes_id')) tep_session_unregister('attributes_id');
  	if(WISHLIST_REDIRECT == 'Yes') {
	  	tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_id));
	  }
  }


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

  if (isset($_POST['add_wishprod'])) {
  	if(isset($_POST['wlaction']) && $_POST['wlaction'] == 'cart') {
	  	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);
			}
			if (DISPLAY_CART == 'true') tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
		}
	}
  


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

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


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

  $wishlist_not_empty = false;
  if (is_array($wishList->wishID) && !empty($wishList->wishID)) {
    $wishlist_not_empty = (count($wishList->wishID) > 0);
  }

  if (isset($_POST['wlaction']) && ($_POST['wlaction'] == 'email') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken) && $wishlist_not_empty) {

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

  	$message = tep_db_prepare_input($_POST['message']);
		if(strlen($message) < 1) {
			$error = true;
			$message_error .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_MESSAGE . "</div>";
		}			
    // check for links to other web sites, a sign that a spammer is trying to use this site to send spam
    $protocols = array('http://', 'https://', 'file://', 'ftp://', 'news://' 'mailto:', 'telnet://', 'ssh:');
    $check = strtolower($message);
    $thisdomain = HTTP_SERVER;
    $thisdomain = strtolower(substr($thisdomain, strpos($thisdomain, '://') + 3));
    foreach ($protocols as $p ) {
      $x = 0;
      while (strpos($check, $p, $x) !== false) {
        $x = strpos($check, $p, $x) + strlen($p);
        if ((substr($check, $x, strlen($thisdomain)) != $thisdomain) || !preg_match('/\/|\s/', substr($check, $x + strlen($thisdomain), 1))) {
          $error = true;
          $message_error .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_INVALID_LINK . "</div>";
        }
      }
    }

 		if(tep_session_is_registered('customer_id')) { // logged in
			$customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
	  	if (tep_db_num_rows($customer_query) != 1 ) tep_redirect(tep_href_link(FILENAME_LOGOFF, '', 'SSL')); // invalid 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 = tep_href_link(FILENAME_WISHLIST_PUBLIC, "public_id=" . $customer_id);
	
			$body = $message . sprintf(WISHLIST_EMAIL_LINK, $from_name, $link, $link);
		} else { // guest
			$from_name = tep_db_prepare_input($_POST['your_name']);
			$from_email = tep_db_prepare_input($_POST['your_email']);
			if(strlen($from_name) < 1) {
				$error = true;
				$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_YOUR_NAME . "</div>";
			}
			if(strlen($from_email) < 1) {
				$error = true;
				$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " .ERROR_YOUR_EMAIL . "</div>";
			} elseif(!tep_validate_email($from_email)) {
				$error = true;
				$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_VALID_EMAIL . "</div>";
			}

			$subject = $from_name . ' ' . WISHLIST_EMAIL_SUBJECT;

			$z = 0;
			$prods = "";
			foreach($_POST['prod_name'] as $name) {
				$prods .= '<a href="' . tep_db_prepare_input($_POST['prod_link'][$z]) .'">' . tep_db_prepare_input($name) . "  " . tep_db_prepare_input($_POST['prod_att'][$z]) . "\n" . tep_db_prepare_input($_POST['prod_link'][$z]) . "</a>\n\n";
				$z++;
			}
			$body = $message . "\n\n" . $prods . "\n\n" . $from_name . WISHLIST_EMAIL_GUEST;
	  }

		//Check each posted name => email for errors.
    $email = tep_db_prepare_input($_POST['email']);
    $friend = tep_db_prepare_input($_POST['friend']);
		for ($j=0; $j < sizeof($friend); $j++) {
		  $friend[$j] = $friend[$j];
			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($friend[$j]) && $friend[$j] != '') {
				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($friend[$j]) < '1') {
					$error = true;
					$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ENTER_NAME . "</div>";
				}
			}
		}

    // check for attempt to send email from another page besides this sites Wish List script
    if (substr($_SERVER['HTTP_REFERER'], 0, strpos($_SERVER['HTTP_REFERER'], '.php') + 4) != tep_href_link(FILENAME_WISHLIST)) {
      if (tep_session_is_registered('customer_id')) {
        $cid = $customer_id;
      } else {
        $cid = TEXT_SPAM_NO_ID;
      }
      $spammsg = sprintf(TEXT_SPAM_MESSAGE, date('l F j, Y  H:i:s'), $cid, $from_name, $from_email, $_SERVER['HTTP_REFERER'], tep_get_ip_address(), $_SERVER['REMOTE_PORT'], $_SERVER['HTTP_USER_AGENT']) . $message;
      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, TEXT_SPAM_SUBJECT, $spammsg, $from_name, $from_email_address);
      foreach ($_SESSION as $key => $value) unset($_SESSION[$key]);
      echo ERROR_SPAM_BLOCKED;
      tep_exit();
    }

    $actionRecorder = new actionRecorder('ar_wish_list', (tep_session_is_registered('customer_id') ? $customer_id : null), $from_name);
    if (!$actionRecorder->canPerform()) {
      $error = true;

      $actionRecorder->record(false);

      $messageStack->add('wishlist', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_WISH_LIST_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_WISH_LIST_EMAIL_MINUTES : 15)));
    }

		if($error == false) {
			for ($j=0; $j < sizeof($friend); $j++) {
				if($friend[$j] != '') {
					tep_mail($friend[$j], $email[$j], $subject, $friend[$j] . ",\n\n" . $body, $from_name, $from_email);
				}
			//Clear Values
				$friend[$j] = "";
				$email[$j] = "";
			}
			$message = "";
			$actionRecorder->record();
     	$messageStack->add('wishlist', WISHLIST_SENT, 'success');
		}
  }


 $breadcrumb->add(NAVBAR_TITLE_WISHLIST, tep_href_link(FILENAME_WISHLIST, '', 'SSL'));
 
 require(DIR_WS_INCLUDES . 'template_top.php');
 if ($messageStack->size('wishlist') > 0) {
    echo '<div>' . $messageStack->output('wishlist') . '</div>';
  }
?>

<h1><?php echo HEADING_TITLE; ?></h1>
<div class="contentContainer"> <?php echo tep_draw_form('wishlist_form', tep_href_link(FILENAME_WISHLIST), 'post', '', true);

if (is_array($wishList->wishID) && !empty($wishList->wishID)) {
	reset($wishList->wishID);
?>
  <table border="0" width="100%" cellspacing="0" cellpadding="3" class="smallTexties">
    <tr>
      <td class="smallTexties"><?php echo BOX_TEXT_IMAGE; ?></td>
      <td class="smallTexties"><?php echo BOX_TEXT_PRODUCT; ?></td>
      <td class="smallTexties"><?php echo BOX_TEXT_PRICE; ?></td>
      <td class="smallTexties" 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 = '" . (int)$product_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
			$products = tep_db_fetch_array($products_query);

		      if (($i/2) == floor($i/2)) {
		        $class = "smallTexties";
		      } else {
		        $class = "smallTexties";
		      }

?>
    <tr class="<?php echo $class; ?>">
      <td valign="top" class="smallTexties" 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-80, SMALL_IMAGE_HEIGHT); ?></a>
        <?php } ?>
        <td valign="top" class="contentTextir" align="left" class="main">
        <strong>
        <?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 } ?>
        </strong>
        <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 = '" . (int)$wishlist_id . "'
                                       and pa.options_id = '" . (int)$option . "'
                                       and pa.options_id = popt.products_options_id
                                       and pa.options_values_id = '" . (int)$value . "'
                                       and pa.options_values_id = poval.products_options_values_id
                                       and popt.language_id = '" . (int)$languages_id . "'
                                       and poval.language_id = '" . (int)$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><em> ' . $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] . '</em></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 = '<del>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</del> <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 /><strong style="color: red">' . TEXT_ITEM_IN_CART . '</strong>';
			}

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

   			if($products['products_status'] == 0) {
   				echo '<br /><strong style="color: red">' . TEXT_ITEM_NOT_AVAILABLE . '</strong>';
  			}
	
			$i++;
?></td>
      <td valign="top" class="smallTexties"><?php echo $products_price; ?></td>
      <td valign="top" class="smallTexties" 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>
  <br />
  <div id="mydiv"></div>
  <?php echo tep_draw_button(BUTTON_TEXT_ADD_CART, 'cart', null, 'primary', array('params' => 'onclick=\'var input = document.createElement("input"); input.setAttribute("type", "hidden"); input.setAttribute("name", "wlaction"); input.setAttribute("value", "cart"); document.getElementById("mydiv").appendChild(input);\'')) . " " . tep_draw_button(BUTTON_TEXT_DELETE, 'trash', null, 'primary', array('params' => 'onclick=\'var input = document.createElement("input"); input.setAttribute("type", "hidden"); input.setAttribute("name", "wlaction"); input.setAttribute("value", "delete"); document.getElementById("mydiv").appendChild(input);\''))?>
  <?php
/*******************************************************************
*********** CODE TO SPECIFY HOW MANY EMAILS TO DISPLAY *************
*******************************************************************/


if(!tep_session_is_registered('customer_id')) {
?>
  <div class="contentTextir">
    <p><?php echo WISHLIST_EMAIL_TEXT_GUEST; ?></p>
    <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>
  </div>
  <?php
	} else {
?>
  <div class="contentTextir">
    <p><?php echo WISHLIST_EMAIL_TEXT; ?></p>
  </div>
  <?php
	}
?>
  <p><?php echo $email_errors; ?></p>
  <?php
	$email_counter = 0;
?>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <?php
	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_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary', array('params' => 'onclick=\'var input = document.createElement("input"); input.setAttribute("type", "hidden"); input.setAttribute("name", "wlaction"); input.setAttribute("value", "email"); document.getElementById("mydiv").appendChild(input);\'')); ?></td>
    </tr>
  </table>
  </form>
  <?php

} else { // Nothing in the customers wishlist

?>
  <div class="smallTexties"> <?php echo BOX_TEXT_NO_ITEMS; ?> </div>
  <?php } ?>
  </form>
</div>
<?php 
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

I cant seem to figure out if i made a mistake in isntalling the add-on, if im just too stupid to figure out how it works.

 

- Jack

Link to comment
Share on other sites

  • 6 months later...

Using 2.3.4 Wishlist 3.0 works perfectly until I activate PDF Datasheet I then get this error:

 

Fatal error: Call to a member function count_contents() on a non-object in/homepages/.../....../htdocs/...../..../.../..../includes/modules/boxes/bm_wishlist.php on line 37

 

I've tried my own workaround, posted earlier, I've checked all files and updates, but nothing will resolve it. If I remove wishlist from the boxes it works perfectly. Can't find any help on the internet either. Please help?!?!? Is it just not compatible with PDF Datasheet?

 

Thanks in advance,

 

Lorraine

Link to comment
Share on other sites

Heres my catalog/includes/application_top.php Can anyone see what's wrong please?

<?php
/*
  $Id$
adapted for Hide products and categories from customer groups for SPPC 2008/08/02

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

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/

// Start the clock 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 support for register_globals
  if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {
    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. Please use PHP 4.3+ if register_globals cannot be enabled on the server.');
  }

// load server configuration parameters
  if (file_exists('includes/local/configure.php')) { // for developers
    include('includes/local/configure.php');
  } else {
    include('includes/configure.php');
  }

// Define the project version --- obsolete, now retrieved with tep_get_version()
  define('PROJECT_VERSION', 'osCommerce Online Merchant v2.3');

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

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

// set php_self in the local scope
  $req = parse_url($HTTP_SERVER_VARS['SCRIPT_NAME']);
  $PHP_SELF = substr($req['path'], ($request_type == 'SSL') ? strlen(DIR_WS_HTTPS_ADMIN) : strlen(DIR_WS_ADMIN));

// Used in the "Backup Manager" to compress backups
  define('LOCAL_EXE_GZIP', 'gzip');
  define('LOCAL_EXE_GUNZIP', 'gunzip');
  define('LOCAL_EXE_ZIP', 'zip');
  define('LOCAL_EXE_UNZIP', 'unzip');

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

// Define how do we update currency exchange rates
// Possible values are 'oanda' 'xe' or ''
  define('CURRENCY_SERVER_PRIMARY', 'oanda');
  define('CURRENCY_SERVER_BACKUP', 'xe');

// 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 application wide 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']);
  }

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

// initialize the logger class
  require(DIR_WS_CLASSES . 'logger.php');

// include shopping cart class
  require(DIR_WS_CLASSES . 'shopping_cart.php');

// define how the session functions will be used
  require(DIR_WS_FUNCTIONS . 'sessions.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);

// set the session name and save path
  tep_session_name('osCAdminID');
  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);
  }

  @ini_set('session.use_only_cookies', (SESSION_FORCE_COOKIE_USE == 'True') ? 1 : 0);

// lets start our session
  tep_session_start();

  if ( (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {
    extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);
  }

// 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'];
  }

// redirect to login page if administrator is not yet logged in
  if (!tep_session_is_registered('admin')) {
    $redirect = false;

    $current_page = $PHP_SELF;

// if the first page request is to the login page, set the current page to the index page
// so the redirection on a successful login is not made to the login page again
    if ( ($current_page == FILENAME_LOGIN) && !tep_session_is_registered('redirect_origin') ) {
      $current_page = FILENAME_DEFAULT;
      $HTTP_GET_VARS = array();
    }

    if ($current_page != FILENAME_LOGIN) {
      if (!tep_session_is_registered('redirect_origin')) {
        tep_session_register('redirect_origin');

        $redirect_origin = array('page' => $current_page,
                                 'get' => $HTTP_GET_VARS);
      }

// try to automatically login with the HTTP Authentication values if it exists
      if (!tep_session_is_registered('auth_ignore')) {
        if (isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) && !empty($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW']) && !empty($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {
          $redirect_origin['auth_user'] = $HTTP_SERVER_VARS['PHP_AUTH_USER'];
          $redirect_origin['auth_pw'] = $HTTP_SERVER_VARS['PHP_AUTH_PW'];
        }
      }

      $redirect = true;
    }

    if (!isset($login_request) || isset($HTTP_GET_VARS['login_request']) || isset($HTTP_POST_VARS['login_request']) || isset($HTTP_COOKIE_VARS['login_request']) || isset($HTTP_SESSION_VARS['login_request']) || isset($HTTP_POST_FILES['login_request']) || isset($HTTP_SERVER_VARS['login_request'])) {
      $redirect = true;
    }

    if ($redirect == true) {
      tep_redirect(tep_href_link(FILENAME_LOGIN, (isset($redirect_origin['auth_user']) ? 'action=process' : '')));
    }

    unset($redirect);
  }

// include the language translations
  $_system_locale_numeric = setlocale(LC_NUMERIC, 0);
  require(DIR_WS_LANGUAGES . $language . '.php');
  setlocale(LC_NUMERIC, $_system_locale_numeric); // Prevent LC_ALL from setting LC_NUMERIC to a locale with 1,0 float/decimal values instead of 1.0 (see bug #634)

  $current_page = basename($PHP_SELF);
  if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
    include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
  }

// define our localization functions
  require(DIR_WS_FUNCTIONS . 'localization.php');

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

// setup our boxes
  require(DIR_WS_CLASSES . 'table_block.php');
  require(DIR_WS_CLASSES . 'box.php');

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

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

// entry/item info classes
  require(DIR_WS_CLASSES . 'object_info.php');

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

// file uploading class
  require(DIR_WS_CLASSES . 'upload.php');

// action recorder
  require(DIR_WS_CLASSES . 'action_recorder.php');

// calculate category path
  if (isset($HTTP_GET_VARS['cPath'])) {
    $cPath = $HTTP_GET_VARS['cPath'];
  } 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;
  }

// initialize configuration modules
  require(DIR_WS_CLASSES . 'cfg_modules.php');
  $cfgModules = new cfg_modules();

// the following cache blocks are used in the Tools->Cache section
// ('language' in the filename is automatically replaced by available languages)
// adapted for Hide products and categories from groups
  $cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language-cg', 'multiple' => true),
                        array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language', 'multiple' => true),
                        array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language-cg', 'multiple' => true)
                       );
// BOF: WebMakers.com Added: Functions Library
    include(DIR_WS_FUNCTIONS . 'webmakers_added_functions.php');
// EOF: WebMakers.com Added: Functions Library
?>
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...