b00 Posted November 6, 2007 Posted November 6, 2007 (edited) Recently Viewed Products(sales optimized) for osCommerce-ms2 Support thread - Recently Viewed Products(sales optimized) Allows your customers to see what products they have recently viewed and then easily allows them to order those products. In an infobox placed in either the right or left column a list of products viewed is displayed. Your customer can then either click on the name of the product or click the "See More" button for the page of recently viewed products. All the products on this page have a buy now button. please check out the screen shot. This is a very effective sales tool that minimizes clicks, making it is easy for a customer to purchase items they have recently viewed. The object in retailing is to increase sales. With this goal in mind, this contribution makes it easier for customers to buy these products. All this is without slowing down the product info page (as no extra database queries are required there). Screenshot included! Keywords: product history, viewing history, browsing history http://addons.oscommerce.com/info/5520 Please report bugs/problems/issues in this thread. Please do not pm/email. thanks - b00 :>) Edited November 6, 2007 by b00 Quote
♥stubbsy Posted November 6, 2007 Posted November 6, 2007 Hi b00 Nice contribution, works well and should come in very handy, just needs some tweaking my end to get the listing to match in with my site. Cheers Dave Quote
jan64 Posted November 6, 2007 Posted November 6, 2007 (edited) Hi, just what i was looking for, but there is no box also not when i have looked some products. i have checked the file's find one thing, you said: <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php i have there one line that says: if ($product_check['total'] < 1) { if i add your code before that i don't have a shop anymore, and after that line is everything OK but there is no box. any idea, i haven't anymore. maybe i there someone with a solution. thanks. regards, Jan Edited November 6, 2007 by jan64 Quote Dreams can come true, if you help them a littlebit
b00 Posted November 6, 2007 Author Posted November 6, 2007 Hi, just what i was looking for, but there is no box also not when i have looked some products. i have checked the file's find one thing, you said: <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php i have there one line that says: if ($product_check['total'] < 1) { if i add your code before that i don't have a shop anymore, and after that line is everything OK but there is no box. any idea, i haven't anymore. maybe i there someone with a solution. thanks. regards, Jan maybe this will help. take a look at the code below and compare it to yours in catalog/product_info.php <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php ///////////// begin recently_viewed if (!tep_session_is_registered('recently_viewed')) { tep_session_register('recently_viewed'); $recently_viewed = $HTTP_GET_VARS['products_id'] . ';'; } $dup_recent_viewed = 'n'; $recent_products = split(';',$recently_viewed); foreach ($recent_products as $recent) { if ($recent == $HTTP_GET_VARS['products_id']) $dup_recent_viewed = 'y'; }//foreach ($recent_products as $recent) { if ($dup_recent_viewed == 'n') $recently_viewed = $HTTP_GET_VARS['products_id'] . ';' . $recently_viewed ; ///////////// end recently_viewed if ($product_check['total'] < 1) { ?> please let me know if this helps, if not please post your product_info.php code and any error messages you received. thanks- b00 Quote
b00 Posted November 6, 2007 Author Posted November 6, 2007 Hi, just what i was looking for, but there is no box also not when i have looked some products. ... maybe i there someone with a solution. thanks. regards, Jan the recently viewed box only shows up when there have been products that have been viewed by the customer (when the customer has viewed the product_info.php page and has exited to another page). thanks - b00 Quote
jan64 Posted November 7, 2007 Posted November 7, 2007 (edited) Hi b00, ok that was the solution, the box is in the column when i have seen some products, but when i click on "see more" i get an error on the DB: 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select count(*) as total from products p, recently_view as rv, products_description pd left join manufacturers m on p.manufacturers_id = m.manufacturers_id where p.products_id in (507,296,543) and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '4' [TEP STOP] ---------------------------------------- i have really no idea :'( regards, Jan Edited November 7, 2007 by jan64 Quote Dreams can come true, if you help them a littlebit
b00 Posted November 7, 2007 Author Posted November 7, 2007 Hi b00, ok that was the solution, the box is in the column when i have seen some products, but when i click on "see more" i get an error on the DB: 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select count(*) as total from products p, recently_view as rv, products_description pd left join manufacturers m on p.manufacturers_id = m.manufacturers_id where p.products_id in (507,296,543) and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '4' [TEP STOP] ---------------------------------------- i have really no idea :'( regards, Jan sorry to say Jan, i do not think this contribution is for you. it seems your products table is different than the stock oscommerce v2.2 table and does not contain the necessary manufacturers_id field. i would venture to guess you may also have a problem with the products_new.php script? it may be possible to add this field to the table, but doing so may have unitended consequences. i am not sure. you have a nice site and i would not make wholesale changes to incorporate this contribution. maybe someone else may have a solution. thanks - b00 Quote
jan64 Posted November 7, 2007 Posted November 7, 2007 (edited) Hi b00, strange that my oscommerce is different, i have 2.2 but it's havenly changed. Ok thanks for your help, i thought it was a nice "recently viewed" contri . maybe somebody knows a solution, who knows. regards, jan PS: i have looked and in the table manufacturers is a field manufacturers_id field sorry to say Jan, i do not think this contribution is for you. it seems your products table is different than the stock oscommerce v2.2 table and does not contain the necessary manufacturers_id field. i would venture to guess you may also have a problem with the products_new.php script? it may be possible to add this field to the table, but doing so may have unitended consequences. i am not sure. you have a nice site and i would not make wholesale changes to incorporate this contribution. maybe someone else may have a solution. thanks - b00 Edited November 7, 2007 by jan64 Quote Dreams can come true, if you help them a littlebit
Jan Zonjee Posted November 7, 2007 Posted November 7, 2007 PS: i have looked and in the table manufacturers is a field manufacturers_id field It's a MySQL5 issue IMHO. Perhaps if you change the query rearranging the tables: ... from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, recently_view as rv, products_description pd ... Quote
b00 Posted November 7, 2007 Author Posted November 7, 2007 It's a MySQL5 issue IMHO. Perhaps if you change the query rearranging the tables: 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select count(*) as total from products p, recently_view as rv, products_description pd left join manufacturers m on p.manufacturers_id = m.manufacturers_id where p.products_id in (507,296,543) and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '4' [TEP STOP] doesn't this mean there is no manufacturers_id field in the products table? thanks - b00 Quote
Jan Zonjee Posted November 7, 2007 Posted November 7, 2007 just for my own curiosity, i don't understand if it is a mysql5 issue, why the error would say: 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select count(*) as total from products p, recently_view as rv, products_description pd left join manufacturers m on p.manufacturers_id = m.manufacturers_id where p.products_id in (507,296,543) and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '4' [TEP STOP] doesn't this mean there is no manufacturers_id field in the products table? No I'm as good as 100% sure that MySQL5 has an issue with this part: products_description pd left join manufacturers m on p.manufacturers_id = m.manufacturers_id It basically tells you that you cannot use p.manufacturers_id in the left join of those two tables because p.manufacturerers_id is not in the table products_description (seen a similar error recently in another thread). Quote
b00 Posted November 8, 2007 Author Posted November 8, 2007 jan s - try replacing the code in your catalog\recently_viewed.php with this(idea for change provided courtesy of jan z): <?php /* recently_viewed.php */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_RECENTLY_VIEWED_MORE); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_RECENTLY_VIEWED_MORE)); ?> <!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; ?> Recently Viewed</title> <base href="<?php echo (($request_type == 'SSL') ? 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"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <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_image(DIR_WS_IMAGES . 'table_background_products_new.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 (strlen(trim($recently_viewed)>0)) { // if (strlen($recently_viewed>1)) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php $prod_viewed = str_replace(";" , "," , $recently_viewed ); $prod_viewed = strtr($prod_viewed, ',,',',' ) ; if (strrpos($prod_viewed , "," ) > 0) { $prod_viewed = substr($prod_viewed,0, strrpos( "," , $prod_viewed ) -1 ) ; }//if (strrpos($prod_viewed , "," ) > 0) { $m_id=0; while ($m_id=0) { $m_id=rand(0,1000000); $ses_id_query = tep_db_query("select ses_id from recently_view for ses_id = '" . $m_id . "' "); if (tep_db_num_rows($ses_id_query)) { $m_id=0; }//if (tep_db_num_rows($ses_id_query)) { }//while ($m_id=0) { $counter = 0; $recent_products = split(';',$recently_viewed); foreach ($recent_products as $recent) { if ((strlen($recent) >0)) { $counter++; if (strlen($counter) < 2) { $counter = '0' . $counter; }//if (strlen($counter) < 2) { tep_db_query(" insert into recently_view (products_id,ses_id,ses_date) VALUES (" . $recent .",". $m_id . ",current_date) "); }//if ((strlen($recent) >0)) { }//foreach ($recent_products as $recent) { $products_array = array(); // original $products_query_raw = "select m.manufacturers_name,rv.rec_v_id, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added,pd.products_description from " . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id where p.products_id in (" . $prod_viewed . ") and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by rv.rec_v_id"; // next line changed for sql5 $products_query_raw = "select m.manufacturers_name,rv.rec_v_id, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added,pd.products_description from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id in (" . $prod_viewed . ") and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by rv.rec_v_id"; $products_split = new splitPageResults($products_query_raw, MAX_DISPLAY_PRODUCTS_NEW); $products_query = tep_db_query($products_split->sql_query); while ($products = tep_db_fetch_array($products_query)) { if ($new_price = tep_get_products_special_price($products['products_id'])) { $products_price = '<s>' . $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>'; } else {//if ($new_price = tep_get_products_special_price($products['products_id'])) { $products_price = $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])); }//if ($new_price = tep_get_products_special_price($products['products_id'])) { ?> <tr> <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td> <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '"><b><u>' . $products['products_name'] . '</u></b></a><br><br>' . $products['products_description']; ?></td> <?php $lc_text = '<div><form name="buy_now_' . $products['products_id'] . '" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product', 'NONSSL') . '">'; $lc_text .= '<input type="hidden" name="products_id" value="' . $products['products_id'] . '">' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absbottom"') . ' '. '<br>'; $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $products['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { // product has attributes $lc_text .= '</div>' . TEXT_PRICE . ' ' . '<b>' . $products_price . '</b><br>' .TEXT_PRODUCT_OPTIONS . '<br>'; $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $products['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $products['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($products['products_tax_class_id'])) .') '; } //($products_options['options_values_price'] != '0') { } //while ($products_options = tep_db_fetch_array($products_options_query)) { if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else {// if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = false; } //if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $lc_text .= ''. $products_options_name['products_options_name'] . ':' .''. '' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '<br>'; $lc_text .= ' '; $lc_text .= '</a><br>'; }//while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $lc_text .= '</form>'; if($products['manufacturers_name']<>'') { ?> <td align="center" valign="middle" class="main"><?php echo TEXT_MANUFACTURER . '<br>' . $products['manufacturers_name'] . '<br><br>' . $lc_text . '</form> ' . '</a>'; ?> <?php } else { //if($products['manufacturers_name']<>'') { ?> <td align="center" valign="middle" class="main"><?php echo $lc_text . '</form> ' . '</a>'; ?> <?php } //if($products['manufacturers_name']<>'') { } Else { //if ($products_attributes['total'] > 0) { // product does not have attributes if($products['manufacturers_name']<>'') { ?> <td align="center" valign="middle" class="main"><?php echo TEXT_MANUFACTURER . '<br>' . $products['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . '<b>' . $products_price . '</b><br><br>' . ' ' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '</a>' . tep_draw_form('buy_now' . $products['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']), 'POST') . '<span align="right" >' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absbottom"') . '</span></form> ' . '</a>'; ?> <?php } else { //if($products['manufacturers_name']<>'') { ?> <td align="center" valign="middle" class="main"><?php echo TEXT_PRICE . ' ' . '<b>' . $products_price . '</b><br><br><br>' . ' ' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '</a>' . tep_draw_form('buy_now' . $products['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']), 'POST') . '<span align="right" >' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absbottom"') . '</span></form> ' . '</a>'; ?> <?php } //if($products['manufacturers_name']<>'') { } //if ($products_attributes['total'] > 0) { ?> </tr> <tr> <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php }//while ($products = tep_db_fetch_array($products_query)) { ?> </td> </tr> <!-- customer_orders_eof //--> <?php // } if (($products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo $products_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td> <td align="right" class="main"><?php echo TEXT_RESULT_PAGE . ' ' . $products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php }//if (($products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) { tep_db_query(" delete from recently_view where ses_id='" . $m_id . "' "); // clean out unneeded records from recently_view db tep_db_query(" delete from recently_view where ses_date < current_date - interval 1 day "); // clean out unneeded records from recently_view db } //if (strlen(trim($recently_viewed)>0)) { ?> </table></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'); ?> please let me know how it works for you. thanks to you all - b00 Quote
jan64 Posted November 8, 2007 Posted November 8, 2007 Goodmorning, yes it works perfect!!! only two little things: "Price: ?18.95" he places a "?" instead of the "€" and when you have seen a product twice, it is showed two times in the list Recently viewed. thats all, verry handy contri. kind regards, Jan Quote Dreams can come true, if you help them a littlebit
mrhandley Posted November 8, 2007 Posted November 8, 2007 Great contrib! This is truly a sales driving function. Thanks a bunch. Some ideas for next release though: - Admin config instead of editing the php file Quite obvious, better to do changes in admin. Pls see below - Multilingual You have a specific language file but then you add text to the box building php? 1. define('RECENTLY_VIEWED_BOX_HEADING',' Du har tittat på:'); // box heading 2. define('RECENTLY_VIEWED_BOX_SEE_MORE_BUTTON',' Hela listan ' ); // see more button text 3. $recently_viewed_box_max_lines = 10; // maximum number of lines in recently viewed box 4. $recently_viewed_box_max_characters_per_line = 30; // maximum number of characters per line in recently viewed box #1 and #2 should be moved to the language file, #3 and #4 should be moved to admin. - Let the user reset the recently viewed I think it would be nice if the visitor could reset the list by themselves - Make it easy to change the layout of the recently viewed page. As it is now, it seems as the page is built with three columns. The first column contains product picture, the second contains descriptive text and the third contains price/manufacturer/add to cart etc. Column 1 is set to show the content in the left top corner. Column 2 is set to show the content in the left top corner. Column 3 is set to show the content in the left middle Wouldn´t be better to display column three in the same way as the others? If you have long product texts it doesnt look good and the user has to search for the "add to cart" button. Quote
jan64 Posted November 8, 2007 Posted November 8, 2007 Is it possible to solve those two little problems? regards, Jan Goodmorning, yes it works perfect!!! only two little things: "Price: ?18.95" he places a "?" instead of the "€" and when you have seen a product twice, it is showed two times in the list Recently viewed. thats all, verry handy contri. kind regards, Jan Quote Dreams can come true, if you help them a littlebit
b00 Posted November 8, 2007 Author Posted November 8, 2007 Goodmorning, yes it works perfect!!! only two little things: "Price: ?18.95" he places a "?" instead of the "€" and when you have seen a product twice, it is showed two times in the list Recently viewed. thats all, verry handy contri. kind regards, Jan sorry jan, i may not have the answer to either, but here goes. problem #1 - in regards to "Price: ?18.95" , maybe check in admin - localization- currencies and see what the symbol left and right are for the currency you use. : www.yoursite.com/catalog/admin/currencies.php problem #2 - you say "when you have seen a product twice, it is showed two times in the list Recently viewed." for me this is not a problem in any of my stores. products visited more than once are only displayed once. this is the case in both my stock oscommerce store(no seo-urls) in my heavily modified stores(with seo-urls). thanks - b00 Quote
jan64 Posted November 9, 2007 Posted November 9, 2007 Hi b00, ofcourse ....... i'm verry sorry for my stupid mistake. the "?" instead of the "€" is because it's my testshop. The problem does not exists :-" Sorry for this. The second one is not really a problem, i told it because when you've seen a product twice the list is become verry long. Maybe it's something for the next version. But it works great and i going to integrate it in my online store. Thanks for the help! kind regards, Jan Quote Dreams can come true, if you help them a littlebit
Tsuri Japan Posted November 13, 2007 Posted November 13, 2007 (edited) Got this working on my store in 5 minutes and it's looking awesome!! My store is just that much better now. If anyone wants they can see mine in action at: Tsurishop Japan Just add something and you'll see it working on the right side below the currencies. Cheers for all the work that went into this one! Regards, Nigel Edited November 13, 2007 by Tsuri Japan Quote
ATise Posted November 22, 2007 Posted November 22, 2007 (edited) Thanks for the mod I have two comments; 1. For some reason when I extract the files form the zip it does not place the php files in the correct folders. So you might want to fix that. It over writes each of them since they are all the same name and extracting to the same location and there is only one php file. That causes a real problem. If people only get one file and load it to all of the locations you list. I was able to pull them from the zip directly to my server after I got a bad error message. Now for my question: When I click on the link see more it leaves the site and goes to ask.com how do I correct this problem. This is what is listed on Ask : Your search for www.mysite.comrecently_viewed.php did not match with any Web results. I don like what I see so far of the mod Thanks Edited November 22, 2007 by ATise Quote Site is underconstruction I am always looking for good advice on how to improve my site fill free to comment. Thanks! ATise
b00 Posted November 24, 2007 Author Posted November 24, 2007 Thanks for the mod I have two comments; 1. For some reason when I extract the files form the zip it does not place the php files in the correct folders. So you might want to fix that. It over writes each of them since they are all the same name and extracting to the same location and there is only one php file. That causes a real problem. If people only get one file and load it to all of the locations you list. I was able to pull them from the zip directly to my server after I got a bad error message. Now for my question: When I click on the link see more it leaves the site and goes to ask.com how do I correct this problem. This is what is listed on Ask : Your search for www.mysite.comrecently_viewed.php did not match with any Web results. I don like what I see so far of the mod Thanks 1. i downloaded the zip files myself and had no problem. maybe there is something wrong with your zip setup or how you are doing it. 2. i believe your HTTP_COOKIE_PATH in the /catalog/includes/configure.php is blank. for this mod to work do the following the steps in this order: --- 1. backup your site completely --- 2. edit your /catalog/includes/configure.php file ---- find this code: define('HTTP_COOKIE_PATH', ''); ---- and replace it with this: define('HTTP_COOKIE_PATH', '/catalog/'); good luck :>) Quote
ATise Posted December 2, 2007 Posted December 2, 2007 1. i downloaded the zip files myself and had no problem. maybe there is something wrong with your zip setup or how you are doing it.2. i believe your HTTP_COOKIE_PATH in the /catalog/includes/configure.php is blank. for this mod to work do the following the steps in this order: --- 1. backup your site completely --- 2. edit your /catalog/includes/configure.php file ---- find this code: define('HTTP_COOKIE_PATH', ''); ---- and replace it with this: define('HTTP_COOKIE_PATH', '/catalog/'); good luck :>) Thanks that did the trick Quote Site is underconstruction I am always looking for good advice on how to improve my site fill free to comment. Thanks! ATise
asian dragon Posted December 13, 2007 Posted December 13, 2007 Hello, This is really a nice contri. Works fine and I do believe it will increase sales. So, thanks for that! I do have one small problem that I'm not able to solve. I do get an error message: 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select count(*) as total from products p, recently_view as rv, products_description pd left join manufacturers m on p.manufacturers_id = m.manufacturers_id where p.products_id in (90,89,93,43,111,110,134) and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '1' [TEP STOP] What is really the problem here? I guess the page 'recently_viewed.php' would show all the items, incl. the images right? Obviously it does not right now, so if anybody has any advice? Quote
golfman2006 Posted December 15, 2007 Posted December 15, 2007 Hello, This is really a nice contri. Works fine and I do believe it will increase sales. So, thanks for that! I do have one small problem that I'm not able to solve. I do get an error message: 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select count(*) as total from products p, recently_view as rv, products_description pd left join manufacturers m on p.manufacturers_id = m.manufacturers_id where p.products_id in (90,89,93,43,111,110,134) and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '1' What is really the problem here? I guess the page 'recently_viewed.php' would show all the items, incl. the images right? Obviously it does not right now, so if anybody has any advice? It seems you may be on MySQL5 as that same error I just resolved on my side. I am not an SQL guru, but was able to get it working properly on my end. On line 79 of catalog/recently_viewed.php, change the query to this: $products_query_raw = "select m.manufacturers_name,rv.rec_v_id, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added,pd.products_description from (" . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id where p.products_id in (" . $prod_viewed . ") and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by rv.rec_v_id"; All I did was change this: " . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd To this: (" . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd) Quote
golfman2006 Posted December 15, 2007 Posted December 15, 2007 Great contribution, just have one question. When I click on "See More", the url looks like this http://www.mysite.com//recently_viewed.php? with two slashes between .com and the PHP file. Any ideas what could be causing this and how to fix? Quote
asian dragon Posted December 15, 2007 Posted December 15, 2007 It seems you may be on MySQL5 as that same error I just resolved on my side. I am not an SQL guru, but was able to get it working properly on my end. On line 79 of catalog/recently_viewed.php, change the query to this: $products_query_raw = "select m.manufacturers_name,rv.rec_v_id, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added,pd.products_description from (" . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id where p.products_id in (" . $prod_viewed . ") and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by rv.rec_v_id"; All I did was change this: " . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd To this: (" . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd) Thanks, that did the trick! It is working perfectly now. I know I'm not a PHP guru either, but why was this change sufficient? I mean, what happened when I placed the brackets around the piece of code? Just curious... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.