Karen, another plugin that you previously installed has modified the function zen_href_link (in /includes/functions/html_output.php) to inject the index.html, perhaps an "SEO"/URL-rewriter?
Karen, another plugin that you previously installed has modified the function zen_href_link (in /includes/functions/html_output.php) to inject the index.html, perhaps an "SEO"/URL-rewriter?
Hi. I have been using your Pagination mod for quite a while, and I love it!
I just came across a new issue, and I'm not sure if it is related to the mod, or is a general zencart issue.
Previously, each of my products was in a single category. But I decided to do a reorganization of my categories, and I created some linked products (I copied some products to a new category, but used the "linked" option so it wouldn't actually make a new copy of the products.)
Now I am noticing some strange behavior when I do a search.
My site is http://www.earth-friendly.com .
If I search for the model number of a product that I have linked to a second category, the search result shows me:
Showing 1 - 2 (of 2 items)
and then it displays a single item.
You can search for HG0635169 and you will see this behavior.
And, if I search for a keyword where there are a number of products that were linked to multiple categories, then it returns additional search pages, but those pages don't show any products.
You can see this behavior if you search for fiber.
Pages 1-4 are fine, but if you go to page 5 and 6, you see:
Showing 49 - 60 (of 67 items)
with no results on the page.
I have a test site, where I haven't created any linked products, and I see the expected behavior in both of these cases.
I have version 1.4.6 of your mod installed, although I believe I got the 1.4.8 bug fix from you a while ago.
So my question is, is this weird search behavior I am seeing due to the mod, or do you think it is a general zencart issue?
It seems that the search results that are coming back are fine, no duplication, but the headers on the search results pages are coming up with higher numbers and more pages than they should, based on the number of products being returned by the search.
Thanks in advance for any help with this issue!
What happens if you temporarily change to the default "Classic Template"? Do the funky numberings still occur?
I just changed to the classic template, and I still had the funky numberings. I tried this on my test site, and I didn't have all the new linked products created--I just created one. And then I searched for the model number, and it gave me the header: Showing 1 - 2 (of 2 items) when there was only 1 item.
Have you made changes to /includes/modules/pages/advanced_search_result/header_php.php? It sounds like the SQL search being submitted by that page's processing is missing a "DISTINCT" keyword.
Hi. Thanks for your help! I looked at the /includes/modules/pages/advanced_search_result/header_php.php page, and I do see the DISTINCT keyword:
$select_str = "SELECT DISTINCT " . $select_column_list .
" m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_price, p.products_qty_box_status, p.master_categories_id ";
so it doesn't look like I have not modified that file in the way you suspected.
I did try something else. I removed the advanced_search_result from "other pages to link", in the Products Pagination configuration page, just to see if I still had the problem when I turned off the Products Pagination for that page, and I do still have the problem. I had added a linked product with "fiber" in the title, and when I do a search for "fiber", it kicks the results into a new page, and I have a blank page displayed for the 5th page.
So, it looks like the Products Pagination mod is unrelated to the problem I am having, and it is caused by something else. I wonder if it is caused by one of the mods I have installed, or if it is a general issue for Zencart. Anyway, I'm sorry to bother you with this. I thought I would try your forum first, because your mod does affect the header text on the advanced search results page, but it seems that the info that you use comes from somewhere else.
Thanks again for your help, and for a great mod!
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
I'm looking at the file includes/classes/split_page_results.php.
I see the lines:
Code://-bof-product pagination // if (strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) { if ((strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) && is_numeric($count_key)) { //-eof-product_pagination $count_string = 'distinct ' . zen_db_input($count_key); } else { $count_string = zen_db_input($count_key); }
I turned debugging on in the file (set $debug=true in splitPageResults function), and I printed out $count_key, as well as the queries which already get printed out when $debug is true.
I see:
so it is calling is_numeric(p.products_id) which is returning false, and it is not getting 'DISTINCT' in the query.Code:count_key=p.products_id count_query=select count(p.products_id) as total FROM (products p LEFT JOIN manufacturers m USING(manufacturers_id), products_description pd, categories c, products_to_categories p2c ) LEFT JOIN meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 1 WHERE (p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id AND ((pd.products_name LIKE '%fiber%' OR p.products_model LIKE '%fiber%' OR m.manufacturers_name LIKE '%fiber%' OR (mtpd.metatags_keywords LIKE '%fiber%' AND mtpd.metatags_keywords !='') OR (mtpd.metatags_description LIKE '%fiber%' AND mtpd.metatags_description !='')) ))
I tried replacing the new code with the commented-out code:
I changed
back toCode:if ((strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) && is_numeric($count_key)) {
and I see the correct results.Code:if (strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) {
So I'm wondering if I can just change that line back to the original line.
I have just been making these changes in my test site, but I wonder if you could check to see if it makes sense to make this change.
Perhaps the call to is_numeric fixed something else, and this might break it in some other way.
Thanks very much for your help!
Hmm, you appear to have a down-level version of the /includes/classes/split_page_results.php file modification. What I've got in the current Products Pagination distribution shows the following on that line:
Code:if ((strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) && $count_key != '*') { /*v1.4.7c*/
Thanks so much for the info! I'm really sorry--I had looked at the description of the newer versions of the mod, but it didn't look like they fixed this specific issue, so I didn't upgrade. I made the change you suggested, and it now works fine! I will be upgrading with all the changes very soon. Thanks again for being so responsive, and for creating a great mod! I really appreciate all your help!
Bookmarks