Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Search Results repeat each product 4 times

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-06-2002, 03:17 PM
 
global global is offline
 

Newbie
  
Join Date: Nov 2002
Location: Los Angeles
Posts: 5
 

Default Search Results repeat each product 4 times

I have made a fair amount of modifications to the template files in x-cart version 3.2.2 Gold. I recently noticed that when a product is found in a storefront search it is displayed 4 times.

I note that customer/home_main.tpl (which I haven't changed) is calling customer/main/search_result.tpl (another template I haven't changed) and it is calling customer/main/products.tpl. I have modified this template, but when I replace it with the original template I get the same result, only formatted differently.

The results are displayed with customer/search.php, which I also have not alterred, and I replaced the include/func.php file that I modified with the original file. I can't see how I could have caused this error.

I have looked at the SQL in search.php and I note that it first identifies what categories a product is in and then uses that in the query

Code:
$search_category = addslashes(array_pop(func_query_first("select category from $sql_tbl[categories] where categoryid='$in_category'"))); $search_query = "($sql_tbl[products].product like '%$substring%' or $sql_tbl[products].descr like '%$substring%') and $sql_tbl[categories].category like '$search_category%' and $sql_tbl[products].forsale='Y' $price_condition ".$sort_by_price;

I imported my products with a csv file and separated the fields with semicolons. I selected a default category from the drop down menu and some products were in 3 additional subcategores. Some products had only 1 subcategory. For those products the csv record used empty values, ie. ;2;;; as opposed to ;2;3;4; for a product that was in three subcategories.

This is the only connection I can think of between the 4 displays of the product in the search results. But I would think that this would only happen for products that were assigned to 1 category and 3 subcategories. It also happens when a product is found that is in 1 category and 1 subcategory.
Reply With Quote
  #2  
Old 12-12-2002, 12:43 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

could you post a link to the site that your working on so we can see what you mean
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 12-12-2002, 01:13 PM
 
global global is offline
 

Newbie
  
Join Date: Nov 2002
Location: Los Angeles
Posts: 5
 

Default xcart_pricing table was causing my error

My error was being caused because I had to upload the same products several times. My process was to drop the xcart_products table, then recreate it, and then empty the xcart_thumbnails table. xcart support informed me that I also needed to empty the xcart_pricing table, which solved the problem.

I was not simply checking the 'drop all products before import' option because I need to control the auto_incremented productid number. By resetting it to 1, the images and options data does not have to be re-entered in their respective tables.

Now, I am struggling with implementing offline processing for my client. As noted at http://forum.x-cart.com/viewtopic.php?t=862&highlight=pgp PGP does not seem to work. I have reset my config.php to store credit card numbers, but I expect to be working on this problem for days.

My client's site is http://www.nylashoes.com/store/.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:29 AM.

   

 
X-Cart forums © 2001-2020