Pagination only shown once, where there should be two instances

Where the problem occurred: * CS-Cart 4.18.1.SP1 (Store Builder)

Details of the problem:
According to the file /design/backend/templates/views/products/components/products_update_features.tpl there should be 2 instances of the pagination buttons:
Once before and once after the div with the class “product-features__group”

But only one instance is shown:

Only the one at the bottom of the page.

When I remove one instance of the pagination.tpl include (from “{include file=” to “disable history=true}” ) something strange happens to the page.
It suddenly shows an extra box saying there are no items found:

This looks like the code “{else}


{/if}” that is being executed as well, even though it should be an else statement.

So it seems to me there is an issue on the pagination.tpl template file which is causing both the if and the else to be triggered.
I’m guessing there is another if/else on the pagination.tpl template causing this behavior, but I can’t seem to find what/where exactly.

How to reproduce the problem:
Just go to edit a product, go to the product features tab where there are enough product features to show the pagination option and see there is only a pagination option at the bottom instead of both top and bottom.

Please use Settings → General → Appearance → Display the ‘Pagination section’ on the top of the listed object

That option is already checked, so that’s not the issue:
(sorry but it’s in dutch)
As shown in the code it doesn’t look like this option does anything on the product features tab. If you look at the code there is no if/else statement around the pagination.tpl include.
The code shows the same include code both before and after the product features, but only the bottom one is shown.

And before the backend redesign it was still working, so it looks like the update broke it.

The same lines is correct case. All conditions are in the pagination.tpl file

But it is required to examine the issue - why the mentioned setting does not work. Do you face the same issue on the CS-Cart demo?

I tried to find a demo for the store builder version, but keep getting redirected to the multi-vendor demo:

So I’ve not been able to test it in a demo yet.

The top pagination has been purposely hidden in the updated admin panel to minimise the number of visual elements present on the page.

You can return it back by changing the following code:

{$show_pagination_open = $show_pagination_open|default:false}

with this one:

{$show_pagination_open = $show_pagination_open|default:true}

In the design/backend/templates/common/pagination.tpl file.

However, could you please tell me why you need the pagination element at both the top and bottom of the page? What is your case?

Thanks, this is the fix I was looking for.

The reason for wanting it at the bottom is that if you have multiple product where you have to edit a product feature on, let’s say page 2, you have to scroll down each time to the bottom of the page to swich to page 2.
While if it’s at the top, you can switch to page 2 straight away, without having to scroll down to the bottom each time.
It saves a lot of time editing.

1 Like

Thank you for you feedback, I’ve passed it to the developers!

I have discussed this with the developers, you can also try to increase the PRODUCT_FEATURES_THRESHOLD constant in the config.php file, from 50 to a greater value, so that all the product features will fit into one page without pagination.

Hi, this is also a good suggestion, which I hadn’t thought of before.
Only downside to this is that, while it saves time not having to use pagination at all, it loses time by having to load a larger number of features.
There’s also the risk with really high number of features on a product that you run into the max number of POST-values set in PHP settings when saving.
So setting the number too high could cause issues.

But it’s a good thing to know and there might be a good sweet spot for us, so thanks for the feedback.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.