Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

BearHappy

Archived
  • Posts

    116
  • Joined

  • Last visited

Everything posted by BearHappy

  1. I was able to get the Analytics basic to work with my STS install. Add the below code to your catalog\includes\sts_display_output.php After: // Load up the <head> content that we need to link up everything correctly. Append to anything that may have been set in sts_user_code.php $template['headcontent'] .= '<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n"; $template['headcontent'] .= $sts_block['headertags']; $template['headcontent'] .= '<base href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . '">' . "\n"; Insert: if ($request_type == 'SSL') { $template['headcontent'] .= '<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">' . "\n"; $template['headcontent'] .= '</script>' . "\n"; $template['headcontent'] .= '<script type="text/javascript">' . "\n"; $template['headcontent'] .= '_uacct="UA-xxxxxx-x";' . "\n"; $template['headcontent'] .= 'urchinTracker();' . "\n"; $template['headcontent'] .= '</script>' . "\n"; } else { $template['headcontent'] .= '<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">' . "\n"; $template['headcontent'] .= '</script>' . "\n"; $template['headcontent'] .= '<script type="text/javascript">' . "\n"; $template['headcontent'] .= '_uacct="UA-xxxxxx-x";' . "\n"; $template['headcontent'] .= 'urchinTracker();' . "\n"; $template['headcontent'] .= '</script>' . "\n"; } Hope this helps... :thumbsup:
  2. Dennis, All seems to be working now on my site. Not sure what the problem was but for some reason it started working after I was able to get my connection fixed through Comcast. Perhpas clearing offline files and my cache had something to do with it? Anyway, contribution works great... Do you need any help repackaging it for release?
  3. I was going to look at it tonight. But for some reason I can't hit my site from any of my P.C.'s... :( I'm thinking its an issue with Comcrap go figure. I'll take a look at it in the morning from work.
  4. Dennis, Not sure what the issue is, I'm still troubleshooting it. Below is an account and password you can use. I've added items from the wishlist to the cart. You'll notice that products with attributes don't seem to stay when there are multiples. Also, this only seems to happen when after you have logged off or closed your browser. I have confirmed that the data for the wishlist attributes is located in the database table. They are just not being returned when you log back in. So, everything you see in the cart should be in the wishlist. Any thoughts? User: [email protected] Password: password
  5. I'm still working on the wishlist stats unless you want Aaron to finish it off. I also noticed an issue with items added to your cart from the wishlist with attributes, not showing "Item in Cart" on your wishlist. Hope that made sense...
  6. Below is the code for the wishlist_public.php, I have also added the two messages to the wishlist language file. <?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 */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WISHLIST); if(!isset($_GET['public_id'])) { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } $public_id = $_GET['public_id']; /******************************************************************* ****************** QUERY CUSTOMER INFO FROM ID ********************* *******************************************************************/ $customer_query = tep_db_query("select customers_firstname from " . TABLE_CUSTOMERS . " where customers_id = '" . $public_id . "'"); $customer = tep_db_fetch_array($customer_query); /******************************************************************* ****************** ADD PRODUCT TO SHOPPING CART ******************** *******************************************************************/ if (isset($HTTP_POST_VARS['add_wishprod'])) { if(isset($HTTP_POST_VARS['add_prod_x'])) { foreach ($HTTP_POST_VARS['add_wishprod'] as $value) { $product_id = tep_get_prid($value); $cart->add_cart($product_id, $cart->get_quantity(tep_get_uprid($product_id, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]); } tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } } $breadcrumb->add(NAVBAR_TITLE_WISHLIST, tep_href_link(FILENAME_WISHLIST, '', 'SSL')); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <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 //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php echo tep_draw_form('wishlist_form', tep_href_link(FILENAME_WISHLIST)); ?> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" colspan="3"><?php echo $customer['customers_firstname'] . HEADING_TITLE2; ?></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 } /******************************************************************* ****** QUERY THE DATABASE FOR THE CUSTOMERS WISHLIST PRODUCTS ****** *******************************************************************/ $wishlist_query_raw = "select products_id from " . TABLE_WISHLIST . " where customers_id = '" . $public_id . "'"; $wishlist_query = tep_db_query($wishlist_query_raw); ?> <!-- customer_wishlist //--> <?php if (tep_db_num_rows($wishlist_query)) { ?> <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 /******************************************************************* ***** LOOP THROUGH EACH PRODUCT ID TO DISPLAY IN THE WISHLIST ****** *******************************************************************/ $i = 0; while ($wishlist = tep_db_fetch_array($wishlist_query)) { $wishlist_id = tep_get_prid($wishlist['products_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 = '" . $wishlist_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"><a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist['products_id'], 'NONSSL'); ?>"><?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></a></td> <td valign="top" class="productListing-data" align="left" class="main"><b><a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist['products_id'], 'NONSSL'); ?>"><?php echo $products['products_name']; ?></a></b> <?php /******************************************************************* ******** THIS IS THE WISHLIST CODE FOR PRODUCT ATTRIBUTES ********* *******************************************************************/ $attributes_addon_price = 0; // Now get and populate product attributes $wishlist_products_attributes_query = tep_db_query("select products_options_id as po, products_options_value_id as pov from " . TABLE_WISHLIST_ATTRIBUTES . " where customers_id='" . $public_id . "' and products_id = '" . $wishlist['products_id'] . "'"); while ($wishlist_products_attributes = tep_db_fetch_array($wishlist_products_attributes_query)) { // We now populate $id[] hidden form field with product attributes echo tep_draw_hidden_field('id['.$wishlist['products_id'].']['.$wishlist_products_attributes['po'].']', $wishlist_products_attributes['pov']); // And Output the appropriate attribute name $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 = '" . $wishlist_products_attributes['po'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $wishlist_products_attributes['pov'] . "' 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']; } echo '<br /><small><i> ' . $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] . '</i></small>'; } // end while attributes for product 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[products_id])) { echo '<br /><font color="#FF0000"><b>' . MESSAGE_IN_CART . '</b></font>'; } if($products['products_status'] == 0) { echo '<br /><font color="#FF0000"><b>' . MESSAGE_AVAILABILITY . '</b></font>'; } $i++; ?> </td> <td valign="top" class="productListing-data"><?php echo $products_price; ?></td> <td valign="top" class="productListing-data" align="center"><?php echo tep_draw_checkbox_field('add_wishprod[]',$wishlist['products_id']); ?></td> </tr> <?php } ?> </table> </td> </tr> <tr> <td align="right"><br /><?php echo tep_image_submit('button_in_cart.gif', 'Add to Cart', 'name="add_prod" value="add_prod"'); ?></td> </tr> </table></form> <?php } else { // Nothing in the customers wishlist ?> <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> <?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'); ?> add to /catalog/includes/languages/english/wishlist.php define('MESSAGE_IN_CART', 'Item in Cart'); define('MESSAGE_AVAILABILITY', 'Item No Longer Available');
  7. Sure I'll take care of the public file. LOL Sugar CRM huh, I'm actually a CRM admin for the company I work for. We use Saratoga Systems iAvenue however on an Oracle back end. So, is Sugar worth it?
  8. Just a reminder; Dennis, be sure to update the public wishlist file like the account based file. As in getting rid of the page count and next page and adding the "Item No Longer Availlable" line.
  9. Darn it, below is the file I was attempting to hack to get some admin stats. But now after I have uploded it I'm getting the dreaded Parse error: parse error, unexpected T_REQUIRE in /public_html/admin/stats_wishlists.php on line 1 error which won't flipp'n go away. I think that adding some attribute reporting and a proper link to the customer record will work fine. I need to cut some useless items such as "Company" out but the real work has already been done. <?php /* $Id: stats_wishlists.php,v 1.00 2005/06/15 Aaron Hiatt [email protected] http://www.scaredrabbit.com osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); ?> <!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> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_NUMBER; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS_COMPANY; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS_WISHLIST; ?></td> </tr> <?php if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS; $customers_query_raw = "select a.entry_company, pd.products_name, w.products_id, c.customers_id, c.customers_firstname, c.customers_lastname from " . TABLE_WISHLIST . " w, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id where c.customers_id = w.customers_id and w.products_id = pd.products_id group by c.customers_firstname, c.customers_lastname order by c.customers_lastname desc"; $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows); // fix counted customers $customers_query_numrows = tep_db_query("select customers_id from " . TABLE_WISHLIST . " group by customers_id"); $customers_query_numrows = tep_db_num_rows($customers_query_numrows); $rows = 0; $customers_query = tep_db_query($customers_query_raw); while ($customers = tep_db_fetch_array($customers_query)) { $rows++; if (strlen($rows) < 2) { $rows = '0' . $rows; } ?> <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CUSTOMERS, 'selected_box=customers&page=1&cID=' . $customers['customers_id'], 'NONSSL'); ?>'"> <td class="dataTableContent" valign="top" align="center"><?php echo $rows; ?>.</td> <td class="dataTableContent" valign="top"><?php echo $customers['customers_firstname'] . ' ' . $customers['customers_lastname']; ?></td> <td class="dataTableContent" valign="top"><?php echo $customers['entry_company']; ?></td> <td valign="top" class="dataTableContent"> <?php $products_query = tep_db_query("select w.products_id, pd.products_id, pd.products_name, c.customers_id from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CUSTOMERS . " c, " . TABLE_WISHLIST . " w where w.customers_id = " . $customers['customers_id'] . " and w.products_id = pd.products_id and c.customers_id = w.customers_id order by pd.products_name"); while ($products = tep_db_fetch_array($products_query)) { echo $products['products_name'] . '<br>'; } ?> </td> </tr> <?php } ?> </table></td> </tr> <tr> <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td> <td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?> </td> </tr> </table></td> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  10. I'm a hack at best, the only other thing I could think of (I'm not sure if this needed), what if someone wants a quantity of an item?
  11. As far as stats, I do use something I pulled from contribs that reports what customers have on thier wishlists. But its lacking the attributes data...
  12. On the note of when a product has been disabled from admin. The product will still show on the wishlist but when added to the cart shows "out of stock". Works for me, the only other thing I could recommend might be below... catalog/wishlist.php $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"); added "p.products_status," to query if($cart->in_cart($wishlist_id)) { echo '<br /><font color="#FF0000"><b>Item in Cart</b></font>'; } if($products['products_status'] == 0) { echo '<br /><font color="#FF0000"><b>Item No Longer Available </b></font>'; } added $products['products_status'] line catalog/admin/includes/functions/general.php tep_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'"); added TABLE_WISHLIST and TABLE_WISHLIST_ATTRIBUTES delete catalog/admin/includes/database_tables.php define('TABLE_WISHLIST', 'customers_wishlist'); define('TABLE_WISHLIST_ATTRIBUTES', 'customers_wishlist_attributes'); added to end of file before ?> These modifications will: A. Mark a product "No long Available" in the wishlist if the item has been disabled. B. Remove a product from all wishlists if the product has been removed from admin. Dennis, Check my code, I could have missed something... Travis
  13. I think he was "wishing" for woman... ;)
  14. Judging by the "action=add_wishlist" I would say that you CRE6.15 came preinstalled with version 2.x of the wishlist module. You might try this forum Wishlist 2.0 or you can always upgrade to version 3.1. I was using version 2.x for the longest time but always found the user interface cumbersome and difficult to understand. This version is much more user friendly and follows the same visual guide lines as the shopping cart.
  15. A couple of things, 1.) Why did you remove the splitPage count for wishlist.php? (just curious) 2.) Don't forget to add the $i = 0; to wishlist.php <?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_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"; ? ? ? ?} ?>
  16. Got it thanks, didn't miss step 11, just messed it up completely... // restore cart contents $cart->restore_contents(); if (sizeof($navigation->snapshot) > 0) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); tep_redirect($origin_href); } else { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } } } } // restore wishlist to sesssion $wishList->restore_wishlist(); Changed to: // restore cart contents $cart->restore_contents(); // restore wishlist to sesssion $wishList->restore_wishlist(); if (sizeof($navigation->snapshot) > 0) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); tep_redirect($origin_href); } else { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } } } }
  17. Yep I got that much, I guess that when the customer logs back in its not pulling the 'wishlist_id' from the database. I'm probably wrong but thats all I could come up with... Everything seems to be working fine while I'm logged in.
  18. Website Sorry when I referred to "table" I meant the actual MySQL table. I also upgraded from version 2.x and everything seems to be working fine other than it will not grab the data for a wishlist when a session has been terminated.
  19. Hmmmm, must be something with my install. When I log off and log back in as a customer the items I previously added are not viewable. So P.C.'s doesn't matter its just not finding the wishlist. I do notice that the table entries are there and it keeps adding the inserts each time I enter something into a new wishlist on the same customer. It kind of seems as though its not able to locate the 'wishlist_id' from a previous session. I'll keep looking...
  20. Dennis, Great update to the contribution, your version is certainly more user friendly. I have one question and I'm not sure if this is by design. When a user (signed into their account) creates a wishlist using one computer can he view the wishlist using another computer when signed into his/her account? It maybe my install and perhaps I'm missing something from the install, but I am not able to view a wishlist that was created using another P.C.
  21. Below is a fix for the Delete, Edit issue in the Admin section. We just needed to replace the "tep_image_submit" with "tep_image_button". I also removed the "Update" button as there was no code behind it. I figure if I want to update a threshold I'll just remove the gift and add it again. OLD: <td class="smallText">'.tep_image_submit('button_update.gif', IMAGE_SEARCH).' <a href="gift_add.php?ID='.$gift['products_id'].'&action=delete">'.tep_image_submit('button_delete.gif', 'Delete').'</a> <a href="categories.php?pID='.$gift['products_id'].'&action=new_product">'.tep_image_submit('button_edit.gif', 'Edit').'</a> </td> NEW: <td><a href="gift_add.php?ID=' . $gift['products_id'] . '&action=delete">' . tep_image_button('button_delete.gif', 'Delete') . '</a> <a href="categories.php?pID=' . $gift['products_id'] . '&action=new_product">' . tep_image_button('button_edit.gif', 'Edit') . '</a></td> Jack, thanks for a great contrib...
  22. Try below, missing semicolon at the end... INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Large Image Width (Pop-up)', 'LARGE_IMAGE_WIDTH', , 'The pixel width of large images (Pop-up)<br>(Use 0 for non-specific size)', 4, 32, now(), now(), NULL, NULL);
  23. Joker, Sorry for the incomplete post, try the below. I have modified the below with what you should be seeing in your application_top.php. Find: ----- // performed by the 'buy now' button in product listings and review page case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { // Wish List 2.3 Start if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id=$products_id"); } // Wish List 2.3 End if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Replace with ------------ // performed by the 'buy now' button in product listings and review page case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Find: ----- case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) { // Wish List 2.3 Start tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id='" . $HTTP_GET_VARS['pid']."'"); // Wish List 2.3 End if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'])); } else { $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // Wish List 2.3 Start // ***************************************** // Remove item from the Wish List case 'remove_wishlist': tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id= '" . $HTTP_GET_VARS['pid'] . "'"); tep_redirect(tep_href_link(FILENAME_WISHLIST)); break; } // end switch $HTTP_GET_VARS['action'] } // end if is set $HTTP_GET_VARS['action'] // Shopping cart actions through POST variables from forms if (isset($HTTP_POST_VARS['wishlist_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)); } $goto = basename($PHP_SELF); switch ($HTTP_POST_VARS['wishlist_action']) { // Customer wants to update the product quantity in their shopping cart case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { // Queries below replace old product instead of adding to queatity. tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); // Read array of options and values for attributes in id[] if (isset ($id)) { foreach($id as $att_option=>$att_value) { // Add to customers_wishlist_attributes table tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )"); } } } } } break; case 'wishlist_add_cart' :if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); // Read array of options and values for attributes in id[] if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; } } } break; // Wishlist Checkboxes case 'add_delete_products_wishlist': if (isset($HTTP_POST_VARS['add_wishprod'])) { if ($HTTP_POST_VARS['borrar'] == 0) { // 'borrar' form variable refers to deleting products in array $add_wishprod[] from wishlist foreach ($HTTP_POST_VARS['add_wishprod'] as $value) { if (ereg('^[0-9]+$', $value)) { $cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]); tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '$value' and customers_id = '" . $customer_id . "'"); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); } if ($HTTP_POST_VARS['borrar'] == 1) { foreach ($HTTP_POST_VARS['add_wishprod'] as $value) { if (ereg('^[0-9]+$', $value)) { tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '$value' and customers_id = '" . $customer_id . "'"); } } tep_redirect(tep_href_link(FILENAME_WISHLIST)); } } break; } // end switch ($HTTP_POST_VARS['wishlist_action']) } // end isset($HTTP_POST_VARS) // ***************************************** // Wish List 2.3 End // include the who's online functions Replace with ------------ case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) { if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'])); } else { $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // Wish List 2.3 Start // ***************************************** // Remove item from the Wish List case 'remove_wishlist': tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id= '" . $HTTP_GET_VARS['pid'] . "'"); tep_redirect(tep_href_link(FILENAME_WISHLIST)); break; } // end switch $HTTP_GET_VARS['action'] } // end if is set $HTTP_GET_VARS['action'] // Shopping cart actions through POST variables from forms if (isset($HTTP_POST_VARS['wishlist_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)); } $goto = basename($PHP_SELF); switch ($HTTP_POST_VARS['wishlist_action']) { // Customer wants to update the product quantity in their shopping cart case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { // Queries below replace old product instead of adding to queatity. tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); // Read array of options and values for attributes in id[] if (isset ($id)) { foreach($id as $att_option=>$att_value) { // Add to customers_wishlist_attributes table tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )"); } } } } } break; case 'wishlist_add_cart' :if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { // Read array of options and values for attributes in id[] if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; } } } break; // Wishlist Checkboxes case 'add_delete_products_wishlist': if (isset($HTTP_POST_VARS['add_wishprod'])) { if ($HTTP_POST_VARS['borrar'] == 0) { // 'borrar' form variable refers to deleting products in array $add_wishprod[] from wishlist foreach ($HTTP_POST_VARS['add_wishprod'] as $value) { if (ereg('^[0-9]+$', $value)) { $cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); } if ($HTTP_POST_VARS['borrar'] == 1) { foreach ($HTTP_POST_VARS['add_wishprod'] as $value) { if (ereg('^[0-9]+$', $value)) { tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '$value' and customers_id = '" . $customer_id . "'"); } } tep_redirect(tep_href_link(FILENAME_WISHLIST)); } } break; } // end switch ($HTTP_POST_VARS['wishlist_action']) } // end isset($HTTP_POST_VARS) // ***************************************** // Wish List 2.3 End // include the who's online functions Basically what I did was to remove the SQL delete queries from the code which removed items from the wishlist. This means that the only way to remove items from your wishlist is to actually select remove...
  24. Sorry, that must have been something I added. You can use the below inserts to add the values to your configuration table. INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Items per Wishlist Page', 'MAX_DISPLAY_WISHLIST_PRODUCTS', '9', 'How many wishlist items to show per page on the main wishlist.php file', 3, 100, '2004-10-08 23:44:48', '2004-06-14 21:22:21', NULL, NULL); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Items in Wishlist Infobox', 'MAX_DISPLAY_WISHLIST_BOX', '5', 'How many wishlist items to display in the infobox before it changes to a counter', 3, 101, '2004-06-14 21:33:24', '2004-06-14 21:26:42', NULL, NULL); Be sure to delete the define statements for these values 'MAX_DISPLAY_WISHLIST_PRODUCTS', 'MAX_DISPLAY_WISHLIST_BOX' from your configure.php.
×
×
  • Create New...