Forums / All Other Contributions/Addons / Products Pagination - Support Thread

Products Pagination - Support Thread

Views: 30,016

Results 81 to 100 of 159
29 May 2014, 2:40 AM
#81
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Products Pagination - Support Thread

Thanks so much for this great mod! I was actually looking for a mod that would let my customers choose how many products to display on a page, for search results, category listings, etc. But I didn't want to modify the individual product pages with any navigation that would let you go to different products within a category. It didn't seem to fit my website. I was able to accomplish this with your mod, by just not uploading changes to the following files:
includes/modules/mytemplate/product_prev_next.php
includes/templates/mytemplate/templates/tpl_products_next_previous.php
I was also able to modify the stylesheets to get the navigation to fit the color scheme of my website. I also changed the language files a little, so the navigation at the top would fit on one line, in many cases.
In case anyone wants to see how I used it, you can go to my website and do a search on a common term, like: vitamin.
http://www.earth-friendly.com
I do have one question.
Right now, for the number of items per page, I have: 12,24,48,96,300,600
In the case of searching for vitamin, it comes back with approximately 400 products. In the pulldown menu, it gives me these choices: 12,24,48,96,300. But, since there are 400 products, that means that I will always have at least 2 pages of products. I would prefer if it gave me a choice of 600 in this case, so I could choose to display them all in 1 page. Is there a place where I can change that? I'm guessing it would be a simple change, where something is off by 1.
Thanks again for a great mod! I really appreciate it. I love the way it looks on my site! :D

29 May 2014, 4:18 PM
#82
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

earth-friendly, I'll look at the code a bit later. I agree with your assessment, there's an incorrect comparison somewhere!

30 May 2014, 9:12 PM
#83
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

I've submitted v1.4.8 to the plugins area, correcting the issue that earth-friendly reported.

1 Jun 2014, 3:19 AM
#84
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Products Pagination - Support Thread

lat9, thanks very much! I don't see the new version there yet. Is it a simple change that I could make to my code? Would you mind telling me what the changes are? That would make it much easier for me, since I have already installed the previous version. Thanks so much for fixing this so quickly!

1 Jun 2014, 1:18 PM
#85
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

Sure, it's a relatively small change to the ppCountDropdown function of /includes/functions/extra_functions/products_pagination_functions.php

function ppCountDropdown ($numItems, $whichCount, $formSuffix) {
  global $getoption_set, $get_option_variable, $cPath, $show_top_submit_button, $show_bottom_submit_button;  // Used on product-listing/index page
  $dropdown = '';
  $countArray = explode(',', PRODUCTS_PAGINATION_COUNT_VALUES);
  if (count($countArray) > 0) {
    $pageArray = array();
    for ($i=0, $n=sizeof($countArray), $done_all = false; $i<$n; $i++) {
      if ($countArray[$i] == '*') {
        if (!$done_all) {
          $pageArray[] = array( 'id' => 'all', 'text' => PP_TEXT_ALL );
          $done_all = true;
          
        }
      } elseif ($numItems > $countArray[$i]) {
        $pageArray[] = array( 'id' => $countArray[$i], 'text' => $countArray[$i]);
        
      } elseif (!$done_all) {
        $pageArray[] = array ('id' => 'all', 'text' => PP_TEXT_ALL);
        $done_all = true;
        
      }
    }
1 Jun 2014, 2:43 PM
#86
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Products Pagination - Support Thread

Thanks, that does the trick!

3 Jun 2014, 7:48 PM
#87
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

You're welcome! v1.4.8 is now available in the plugins area.

13 Jul 2014, 1:55 PM
#88
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

I've submitted v1.4.9 to the Plugins for approval. This version includes a previously-missed change for full Zen Cart v1.5.2/v1.5.3 compatibility.

14 Jul 2014, 7:39 PM
#89
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

lat9:

I've submitted v1.4.9 to the Plugins for approval. This version includes a previously-missed change for full Zen Cart v1.5.2/v1.5.3 compatibility.
... and it's now available! The plugin-reviewers are working overtime!

21 Oct 2014, 4:01 AM
#90
kipper777 avatar

kipper777

New Zenner

Join Date:
Sep 2009
Posts:
1
Plugin Contributions:
0

Re: Products Pagination - Support Thread

Thank you. I do have one problem I need assistance. I had to place an index.html on the root of the website. I had to adjust other zencart files to allow an index.html on the root where it should go to index.php

When I click on a page, like click page 3 of the pagination, it has index.html in the path

http://theplaypages.com/index.html?manufacturers_id=106&page=3&sort=20a

I need it to be
http://theplaypages.com/index.php?manufacturers_id=106&page=3&sort=20a

I have removed the index.html on theplaypages.com for now because this is a live site and can't have the pagination broken.
Can you tell me which file to fix this in?
Why is it pointing to an index.html file anyway...

Thanks for your help in advance,
Karen

21 Oct 2014, 1:42 PM
#91
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

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?

6 Mar 2015, 7:28 PM
#92
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Products Pagination - Support Thread

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!

6 Mar 2015, 7:39 PM
#93
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

What happens if you temporarily change to the default "Classic Template"? Do the funky numberings still occur?

6 Mar 2015, 9:30 PM
#94
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Products Pagination - Support Thread

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.

7 Mar 2015, 4:46 PM
#95
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

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.

8 Mar 2015, 1:06 AM
#96
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Products Pagination - Support Thread

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!

8 Mar 2015, 1:38 AM
#97
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Products Pagination - Support Thread

earth-friendly:

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!

Not a general issue for Zen Cart.. you have a mod which has done this.. suggest that if you compare the search template page and header to the Zen Cart defaults.. You might want to start a new topic to get more help..

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.

8 Mar 2015, 2:33 AM
#98
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Products Pagination - Support Thread

I'm looking at the file includes/classes/split_page_results.php.
I see the lines:

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

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 !='')) ))

so it is calling is_numeric(p.products_id) which is returning false, and it is not getting 'DISTINCT' in the query.
I tried replacing the new code with the commented-out code:
I changed

 if ((strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) && is_numeric($count_key)) {

back to

if (strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) {

and I see the correct results.
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!

8 Mar 2015, 1:19 PM
#99
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Products Pagination - Support Thread

earth-friendly:

I'm looking at the file includes/classes/split_page_results.php.
I see the lines:

//-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);
}

> 
> ...
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:
if ((strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) && $count_key != '*') {  /*v1.4.7c*/
11 Mar 2015, 3:09 AM
#100
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Products Pagination - Support Thread

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!