Jump to content

Pagination 6.4.9


Claudia

Recommended Posts

Did something change with the pagination with CC6.4.9 or is it my custom code?

 

1.  On all pages of my store, even checkout, there is a } on the top left corner - see image

89532565_Capturepaginationlogo.PNG.b517ea8ebd927487c52e1ba8df405616.PNG

 

2.  On the category page my pagination is messed up. If I have multiple pages and click on the individual number it's ok.  But if I click on view all it gives me a blank screen except for this in the top left corner - See image

1989555539_CapturePagination.PNG.c68d7ec268c66cf54f2d2d373a5ccdfe.PNG

 

3.  Here's the code of my top pagination on the category page:

{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}

 

4.  Here’s the code for the bottom pagination on the category page that I've always used:

1845340970_Capturepaginationbottom.PNG.e2181c72d4a9e42e37cf167a868f06d5.PNG

 {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>

   {if $page!=='all' && ($page < $total)}

   {$params[$var_name] = $page + 1}

   {* Add "hide-for-medium-up" to the class attribute to not display the more button *}

   <a href="{$current}{http_build_query($params)}{$anchor}" data-next-page="{$params[$var_name]}" data-cat="{$category.cat_id}" class="button tiny expand ccScroll-next hide-for-medium-up">{$LANG.common.more} <svg class="icon"><use xlink:href="#icon-angle-down"></use></svg></a>

   {/if}

<div class="text-center hide" id="loading"><svg class="icon-x3"><use xlink:href="#icon-spinner"></use></svg></div>

</div>

 

5.  When I noticed the above I looked at my error log and I still had over 800 errors even though I had changed my ini.inc.php file as Brian suggested.  Is it always going to be like this? 

 

6.  Here's what was in the error log pertaining to the pagination.

 

Today, 10:58   [<strong>Exception</strong>]

[<strong>Deprecated</strong>] /home/xxxxx/public_html/classes/cache/file.class.php:224 - preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated

https://www.cambargainstore.com/ashtrays?page=1         

 

Today, 10:58   [<strong>Exception</strong>] /home/xxxxxx/public_html/cache/skin/918a8a00811b40113065ec26a12d2bc080540e8b_0.file.element.paginate.php.php:43 - Unsupported operand types: string - int

https://www.cambargainstore.com/ashtrays?page=all

Today, 10:58   [<strong>Deprecated</strong>] /home/xxxxxxx/public_html/classes/cache/file.class.php:224 - preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated

https://www.cambargainstore.com/ashtrays?page=3         

 

Today, 10:58   [<strong>Deprecated</strong>] /home/xxxxxxx/public_html/classes/cache/file.class.php:224 - preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated

https://www.cambargainstore.com/ashtrays?page=2

 

As always I truly appreciate any and all help

Claudia

Capture pagination top.PNG

Link to comment
Share on other sites

For #6, please see:

https://github.com/cubecart/v6/issues/3114

To fix this, make this edit:

In /classes/gui.class.php, near lines 1305-1310, find:

            $GLOBALS['cache']->write($vars, $cache_id); // See #3026 and #3114
            $GLOBALS['smarty']->assign('POPULAR', $vars);
            $content = $GLOBALS['smarty']->fetch('templates/box.popular.php');
            $GLOBALS['smarty']->assign('POPULAR_PRODUCTS', $content);
      /*}*/
    }

Make a comment of the first line:

         // $GLOBALS['cache']->write($vars, $cache_id); // See #3026 and #3114
            $GLOBALS['smarty']->assign('POPULAR', $vars);
            $content = $GLOBALS['smarty']->fetch('templates/box.popular.php');
            $GLOBALS['smarty']->assign('POPULAR_PRODUCTS', $content);
      /*}*/
    }

 

Link to comment
Share on other sites

In the template "element.paginate.php", I am guessing the culprit is this line:

Near line 19:

    {$params[$var_name] = $page-1}

Try this:

    {$params[$var_name] = $page - 1}

Also do the same for line 13 - put spaces on either side of the dash.

You may need to have CubeCart clear its internal cache after this skin edit.

Link to comment
Share on other sites

I did as you said

Line 19: {$params[$var_name] = $page - 1}

Line 13: {if ($page >= $show - 1)}

It still doesn't work - same issues.

Here's what I got in the error log

  [<strong>Exception</strong>] /home/cambarga/public_html/cache/skin/918a8a00811b40113065ec26a12d2bc080540e8b_0.file.element.paginate.php.php:43 - Unsupported operand types: string - int
https://www.cambargainstore.com/aromatherapy?page=all
    [<strong>Exception</strong>] /home/cambarga/public_html/cache/skin/918a8a00811b40113065ec26a12d2bc080540e8b_0.file.element.paginate.php.php:43 - Unsupported operand types: string - int
https://www.cambargainstore.com/aromatherapy?page=all

 

Link to comment
Share on other sites

Ah! page=all means that {$page} is something that does not look like a number.

It seems this problem should have been evident for many (probably all) versions of CC6.

There have been no relevant changes to that template.

I will explore some more.

Link to comment
Share on other sites

For #3, have you tried:

Instead of:

{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}

Use:

{if $PAGINATION}
<div class="row text-right right">
   <div class="small-6 medium-12 large-12 columns show-for-medium-up thinpad-top">{$PAGINATION}</div>
</div>
{/if}

 

Link to comment
Share on other sites

What is your "cam-1" skin based off of?

If the code you are using is similar to CC5, then please know that CC6 (not sure what version) has changed that to expect a drop-down selector to force a limit on the number of products to show per page - instead of all of them.

The "bug", so to speak, is that CC6 can no longer deal with 'page=all', but did not provide code to catch that should it happen.

Edited by bsmither
Link to comment
Share on other sites

It's based off Foundation.  When I upgraded to  6.4.9 I went thru each file to see what changes were made.  I just noticed that my other store that is running 6.4.7 has this same issue.

"The "bug", so to speak, is that CC6 can no longer deal with 'page=all', but did not provide code to catch that should it happen."

What can I do to remedy this?

Link to comment
Share on other sites

There are two immediate choices:

  • Re-code the skins to not show "View All" and implement the code that Foundation now uses for a drop-down selector.
  • Wait for a customization to the core code to deal with "?page=all"

For the first, examine the bottom of Foundation's template content.catalogue.php and use the 'traditional' sub-template. Then make sure "cam-1" has the template element.category.pagination.traditional.php.

Also, look at the bottom of Foundation's element.paginate.php and note that the code to show "View All" has been commented out.

An issue has been posted in the Github:

https://github.com/cubecart/v6/issues/3133

 

Edited by bsmither
Link to comment
Share on other sites

As for the closing parenthesis, examine the template main.php. There may be a rogue paren anywhere between the code in these two lines:

      {include file='templates/element.google_analytics.php'}
      {include file='templates/element.js_head.php'}

If not then examine the template element.js_head.php. There may be a rogue paren anywhere above or before the code in this line:

{combine input=$js_head output='cache/js_head.{$SKIN_FOLDER}.js' age='604800' debug=$CONFIG.debug||!$CONFIG.cache}

 

Edited by bsmither
Link to comment
Share on other sites

I have looked thru those files and more many times and I can't find a rogue }.  Probably looking right at it and don't see it knowing me.

I changed to the dropdown box for the pagination but I hope this gets resolved sooner than later - that box is ugly LOL

Link to comment
Share on other sites

For the <select> styling, try this:

In element.paginate.php, find:

<ul class="pagination" id="element-paginate">

Change to:

<ul class="pagination" id="element-paginate" style="padding-top:6px ! important;">

In element.category.pagination.traditional.php, find:

<div class="row">

Change to:

<div class="row" style="margin-right:12px;">

Find:

<select class="url_select">

Change to:

<select class="url_select"
        style="
        width: 145px;
        height: 30px;
        border: 1px solid #999;
        font-size: 9px;
        color: #1c87c9;
        background-color: #eee;
        border-radius: 5px;
        box-shadow: 4px 4px #ccc;">

 

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.

×
×
  • Create New...