yoja Posted April 16, 2003 Share Posted April 16, 2003 Thanks all for your comments! I've updated the package and submitted a v0.2 Let me know if v0.2 doesnt work! Link to comment Share on other sites More sharing options...
strictlypc Posted April 16, 2003 Share Posted April 16, 2003 Hi Yoja, I was wondering if you could include a copy of your product_info.php file so that I can do a compare between my file and your file. I can't seem to get this to work. Thanks, David [email protected] Link to comment Share on other sites More sharing options...
Waza04 Posted April 16, 2003 Share Posted April 16, 2003 I cant get it to work either :( I get this error: 1054 - Unknown column '3_15' in 'where clause' SELECT products.products_id FROM products , products_to_categories WHERE products.products_id = products_to_categories.products_id AND products_to_categories.categories_id = 3_15 [TEP STOP] Any help from anybody would be well appreciated!! Warren Link to comment Share on other sites More sharing options...
fstuurman Posted April 16, 2003 Share Posted April 16, 2003 Hello, I have the same problem and it looks like the use of cPath variable has been changed in the latest release , it can also contain 1_9. I have added/changed the following: $cPath_old = substr(strrchr($cPath , '_'),1); $products_ids = tep_db_query("SELECT products.products_id FROM " . TABLE_PRODUCTS . " , " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products.products_id = products_to_categories.products_id AND products_to_categories.categories_id = '" . $cPath_old ."'"); With kind regards , Fred Stuurman Link to comment Share on other sites More sharing options...
Waza04 Posted April 16, 2003 Share Posted April 16, 2003 Hello,I have the same problem and it looks like the use of cPath variable has been changed in the latest release , it can also contain 1_9. I have added/changed the following: $cPath_old = substr(strrchr($cPath , '_'),1); $products_ids = tep_db_query("SELECT products.products_id FROM " . TABLE_PRODUCTS . " , " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products.products_id = products_to_categories.products_id AND products_to_categories.categories_id = '" . $cPath_old ."'"); Thanks it works perfectly!!! Warren Link to comment Share on other sites More sharing options...
Ajeh Posted April 16, 2003 Share Posted April 16, 2003 I was running into errors on different category levels. This is what I am using to handle the category and products_status so that this works with various levels deep in the categories. <?php // calculate the previous and next $products_ids = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_status = '1' and p.products_id = ptc.products_id and ptc.categories_id = $current_category_id"); while ($product_row = tep_db_fetch_array($products_ids)) { $id_array[] = $product_row['products_id']; } reset ($id_array); $counter = 0; while (list($key, $value) = each ($id_array)) { if ($value == $products_id) { $position = $counter; if ($key == 0) $previous = -1; // it was the first to be found else $previous = $id_array[$key - 1]; if ($id_array[$key + 1]) $next_item = $id_array[$key + 1]; else { $next_item = $id_array[0]; } } $last = $value; $counter++; } if ($previous == -1) $previous = $last; $category_name_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = $current_category_id AND language_id = $languages_id"); $category_name_row = tep_db_fetch_array($category_name_query); ?> Link to comment Share on other sites More sharing options...
strictlypc Posted April 16, 2003 Share Posted April 16, 2003 Hi Warren, Any Chance you can email me a copy of your product_info.php file. I still can't seem to get this to work. Thanks, David [email protected] Link to comment Share on other sites More sharing options...
strictlypc Posted April 17, 2003 Share Posted April 17, 2003 Hi, WooHoo! Finally got it to work. Now I'm happy :D David Link to comment Share on other sites More sharing options...
Waza04 Posted April 17, 2003 Share Posted April 17, 2003 Hi, WooHoo! Finally got it to work. Now I'm happy :D David Well Done - I was just going to email you with my file.... lol Warren Link to comment Share on other sites More sharing options...
Waza04 Posted April 17, 2003 Share Posted April 17, 2003 BTW - I think Lindas version works better!!! Warren Link to comment Share on other sites More sharing options...
Ajeh Posted April 18, 2003 Share Posted April 18, 2003 It has a few pluses ... 8) I need to upload it as I have a couple additional changes and so far, regardless of how I get to the product_info.php I do not break any more. Keep your finger's crossed! :D Link to comment Share on other sites More sharing options...
brighthorizon Posted April 20, 2003 Share Posted April 20, 2003 Loved your site sooooo much....I placed an order.... :onfire: ps. how did you get the background picture into the info boxes??? Link to comment Share on other sites More sharing options...
JenRed Posted April 21, 2003 Share Posted April 21, 2003 I tried all the code changes suggested here! Finally ending up with Linda's one. I don't have those errors people above were getting any more, but now all I have is the text: Product 1/ from It's not clickable even. What have I done wrong? Jen I haven't lost my mind - I have it backed up on disk somewhere. Link to comment Share on other sites More sharing options...
Ajeh Posted April 21, 2003 Share Posted April 21, 2003 I tried all the code changes suggested here! Finally ending up with Linda's one. I don't have those errors people above were getting any more, but now all I have is the text: Product 1/ from One thing I did not check on my code is I already had a link for the categories ... and modifed my code to have two image buttons. That peice you may want to go back to the original code for. Mine looks like: http://www.8thoctave.com/osc_freecall/prod..._id=35&cPath=21 My category link includes in the left corner the category image and name and is not a part of this peice of code, but part of another setting I use. Link to comment Share on other sites More sharing options...
Ajeh Posted April 21, 2003 Share Posted April 21, 2003 This is my code section for the links and buttons: <tr> <td> <table border="0" align="center"> <tr> <td align="left" class="main"><a href="<? echo tep_href_link(FILENAME_PRODUCT_INFO, "products_id=$previous&cPath=$cPath"); ?>"><?php echo tep_image_button('button_prev.gif', IMAGE_BUTTON_PREVIOUS); ?></a></td> <!-- <td align="center" class="main"><?php echo (PREV_NEXT_PRODUCT); ?><?php echo ($position+1 . "/" . $counter); ?><br><?php echo (PREV_NEXT_FROM) ?><?php echo ($category_name_row['categories_name']); ?></td> --> <td align="center" class="main"><?php echo (PREV_NEXT_PRODUCT); ?><?php echo ($position+1 . "/" . $counter); ?></td> <td align="right" class="main"><a href="<? echo tep_href_link(FILENAME_PRODUCT_INFO, "products_id=$next_item&cPath=$cPath"); ?>"><?php echo tep_image_button('button_next.gif', IMAGE_BUTTON_NEXT); ?></a></td> </tr> </table> </td> </tr> Try switching which row is commented out and see if that doesn't keep everything working but bring back your link. Link to comment Share on other sites More sharing options...
JenRed Posted April 21, 2003 Share Posted April 21, 2003 Linda Something strange is happening! I worked out how to get the "Prev" and "Next" links in there but there is a problem: eg. You go to this page: http://www.redinstead.com.au/product_info..../products_id/55 and both the Prev and the Next link try to take you to this page: http://www.redinstead.com.au/product_info..../cPath/21_25_28 And the text still says: Product 1/ Any ideas? thanks Jen I haven't lost my mind - I have it backed up on disk somewhere. Link to comment Share on other sites More sharing options...
Ajeh Posted April 21, 2003 Share Posted April 21, 2003 What happens if you turn off the Search Engine Friendly URLs? Link to comment Share on other sites More sharing options...
JenRed Posted April 21, 2003 Share Posted April 21, 2003 If I am here: http://www.redinstead.com.au/product_info....?products_id=55 both the next and prev links take me to: http://www.redinstead.com.au/product_info....&cPath=21_25_28 Jen ps Should SE friendly stay turned off? I could never quite decide on the evidence here at the forums I haven't lost my mind - I have it backed up on disk somewhere. Link to comment Share on other sites More sharing options...
Ajeh Posted April 21, 2003 Share Posted April 21, 2003 SE Friendlies only work on some servers and is not really working properly on many. As to the Previous/Next it looks like the select statement is not grabbing the correct info. If I get time tonight, I will try to package up all my changes, as I have this as an include file now and have updated a few things on it. I think I have most of that posted but I could be missing a peice which is breaking it for you right now. Link to comment Share on other sites More sharing options...
JenRed Posted April 21, 2003 Share Posted April 21, 2003 Okay - thanks a lot. I have this topic on "watch" so I will wait for your changes. :) Jen I haven't lost my mind - I have it backed up on disk somewhere. Link to comment Share on other sites More sharing options...
Ajeh Posted April 21, 2003 Share Posted April 21, 2003 I added my version of this: http://www.oscommerce.com/community/contributions,1164 It is not a very eligant contributuons. Just has the file to be added to /includes and if you read the file it shows the include statement for product_info.php and the define statements to add to your language file. Link to comment Share on other sites More sharing options...
Ramesh Posted April 21, 2003 Share Posted April 21, 2003 Neat useful / necessary feature. The only thing I can add is that if a user/customer performs a search and goes to result 1, he/she will expect next /prev to go through the search results . ***Check your site ***** Also I looked at a site using this feature (Cannot remember which site-it was late last night ). If you hover over the buttons the ALT text comes up as 'reviews'. any thoughts ? Special Effects / 3d + Flash Link to comment Share on other sites More sharing options...
Ajeh Posted April 21, 2003 Share Posted April 21, 2003 I forgot to edit the ALT settings?! :shock: Gads ... it's always something ... and if it's not something, then it's something else ... :wink: Link to comment Share on other sites More sharing options...
Ajeh Posted April 21, 2003 Share Posted April 21, 2003 You know ... might be interesting to set a variable like $products_next_prev_list to the current array from Advance Search or New Products ... and when set have it use that array ... and when not set have it use the generated array of the products category. I will have to fool with this idea. Then have between the buttons if there is a $products_next_prev_list it read where it came from so the customer knows what they are being shown. Link to comment Share on other sites More sharing options...
JenRed Posted April 22, 2003 Share Posted April 22, 2003 hi Linda I just replaced the code in my product_info.php with the one you supplied in your mod above. I am assuming I can just do it that way instead of adding it as an "include". Unfortunately exactly the same thing is happening as before. ie. If I am here: http://www.redinstead.com.au/product_info....?products_id=55 both the next and prev links take me to: http://www.redinstead.com.au/product_info....&cPath=21_25_28 and the text in the middle is still: Product 1/ from I have no idea why! :) Jen I haven't lost my mind - I have it backed up on disk somewhere. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.