Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Add Pagination To A New Page For Viewing Products Rate Topic   - - - - -

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 15 December 2015 - 01:25 PM #1

How do you add pagination to a new page ( view page dispatch) for the products listed on that page?


Warm Regards,
Admin | MVE: 4.2.4

 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3312 posts

Posted 15 December 2015 - 02:26 PM #2

How do you add products to a page?


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 15 December 2015 - 03:46 PM #3

Not sure if it is the correct method but what we tried was as below:

 

Goto Design > Layouts > Add Location

Add a new location with details as below:

Dispatch : View Page : pages.view

Name: TESTPAGE

Goto Pages Tab > Add Page > (eg. TESTPAGE) which was created as below

[From the Website > Content > Add Page > TEST PAGE]

 

Now on the Layout of the Page created above in the LAYOUT

 

Add a Grid > Add a block > Product Showcase 

Now add Products manually to this block.

 

Goto the Page created in the Website > Content and do a Preview that page the products will show but they come all together without no pagination.

 

How to add Pagination?


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19161 posts

Posted 15 December 2015 - 03:59 PM #4

I am afraid, it is not possible to add pagination for blocks with products.

 

But please check how the new pages with products are realized in the Bestsellers module (on sale, newest, etc)

 

Controller:

app/addons/bestsellers/controllers/frontend/products.post.php

 

Templates:

design/themes/YOUR_THEME/templates/addons/bestsellers/views/products/bestsellers.tpl


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 15 December 2015 - 04:08 PM #5

Is there a help / guide on how to create a page with pagination for products ?


Warm Regards,
Admin | MVE: 4.2.4

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 15 December 2015 - 04:16 PM #6

I am afraid, it is not possible to add pagination for blocks with products.

 

But please check how the new pages with products are realized in the Bestsellers module (on sale, newest, etc)

 

Controller:

app/addons/bestsellers/controllers/frontend/products.post.php

 

Templates:

design/themes/YOUR_THEME/templates/addons/bestsellers/views/products/bestsellers.tpl

 

We dont have a frontend folder below bestseller\controllers 


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19161 posts

Posted 16 December 2015 - 07:46 AM #7

We dont have a frontend folder below bestseller\controllers 

 

Sorry, it was added in the latest CS-Cart versions


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3312 posts

Posted 16 December 2015 - 12:09 PM #8

A page with pagination should receive not only 'products' array, but the 'search' one.

 

You can see in app/controllers/frontend/products.php the following lines:

list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));
...
Registry::get('view')->assign('products', $products);
Registry::get('view')->assign('search', $search);

The $products array is products as they are.

The $search array is used in the 'common/pagination.tpl' for creating pages.

 

But when you add products to the products block, only $products array is passed. Even if you do include the common/pagination.tpl file, there will not be anything to display


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 16 December 2015 - 02:11 PM #9

Thanks Simtech for the info, but then what is the workaround to have pagination on a page with products in a block?


Warm Regards,
Admin | MVE: 4.2.4

 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3312 posts

Posted 16 December 2015 - 02:58 PM #10

I am afraid - too many code changes should be performed. Manual filling even cannot take the 'items per page' parameter to split the array into pages.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19161 posts

Posted 16 December 2015 - 03:28 PM #11

Thanks Simtech for the info, but then what is the workaround to have pagination on a page with products in a block?

 

It is not a trivial task since blocks can have different types of filling (manually, newest, bestsellers, etc) and different amount of items per page. So we recommend you to create separate page with products which will use built-in functions as in the Bestsellers module in the latest CS-Cart versions.

 

You can download the latest version from the CS-Cart website and check the mentioned files. The code is quite clear there


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3312 posts

Posted 17 December 2015 - 09:28 AM #12

You can also try another filling, not manual.

When you use 'manual' filling, all selected items will be loaded as if on one page, without separating or limitation of 'items per page'.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19161 posts

Posted 17 December 2015 - 09:51 AM #13

You can also try another filling, not manual.

When you use 'manual' filling, all selected items will be loaded as if on one page, without separating or limitation of 'items per page'.

 

Unfortunately, it does not depend on filling types 


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • beta
  • Member
  • Trial users
  • Join Date: 18-Oct 11
  • 48 posts

Posted 07 December 2018 - 07:37 PM #14

Hi,

How to sorting manual selected products order by timestamp on manually filling block?

 

this code not working after 'picker' line

'params' => array (
    'sort_by' => 'timestamp',
),


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19161 posts

Posted 10 December 2018 - 05:53 AM #15

Try to enable My changes addon and create the following file

 

app/addons/my_changes/schemas/block_manager/blocks.post.php

<?php

$schema['products']['content']['items']['fillings']['manually']['params'] = array(    
    'sort_by' => 'timestamp',
    'sort_order' => 'desc',
);

return $schema;

Then clear cache

 

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • beta
  • Member
  • Trial users
  • Join Date: 18-Oct 11
  • 48 posts

Posted 15 December 2018 - 06:34 PM #16

hello eComlabs,

 

 

Try to enable My changes addon and create the following file

 

app/addons/my_changes/schemas/block_manager/blocks.post.php

<?php

$schema
['products']['content']['items']['fillings']['manually']['params'] = array(   
'sort_by' => 'timestamp',
    'sort_order' => 'desc',
);

return $schema;

Then clear cache

 

not working!

 

thank you



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19161 posts

Posted 17 December 2018 - 05:31 AM #17

hello eComlabs,

 

 

not working!

 

thank you

 

It should work. Try to delete the var/cache directory manually


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.