X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Search Results repeat each product 4 times (https://forum.x-cart.com/showthread.php?t=890)

global 12-06-2002 03:17 PM

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.

shan 12-12-2002 12:43 PM

could you post a link to the site that your working on so we can see what you mean

global 12-12-2002 01:13 PM

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/.


All times are GMT -8. The time now is 06:22 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.