Jump to content

Show all products on one page for particular category


babyewok

Recommended Posts

in this case it's necessary to modify the CMSController, moreover, if you want to configure it via back office, it will be necessary to modify also admin controllers and database to store information about new feature. This is the only possible way

Link to comment
Share on other sites

it will not be as easy as it seems.

copy contents of category controller (init function) to cms controller (also init function)

remember that you have to change things like id of category (because in category controller id of category is a part of $_GET variables)

Link to comment
Share on other sites

Or to change somethig in FrontController.php via an override as I see that had productsort and pagination in there.  Could I not put something in there to manually set the the default orderby, orderway and product number for specific categories vi asome kind of if statement?  For example:

if (something to reference a list of category ids){
$this->context->smarty->assign(array(
			'orderby' => $this->orderBy,
			'orderway' => $this->orderWay,
			'orderbydefault' => name,
			'orderwayposition' => asc,
			'orderwaydefault' => asc,
			'stock_management' => (int)$stock_management));


} else {

$this->context->smarty->assign(array(
			'orderby' => $this->orderBy,
			'orderway' => $this->orderWay,
			'orderbydefault' => $order_by_values[(int)Configuration::get('PS_PRODUCTS_ORDER_BY')],
			'orderwayposition' => $order_way_values[(int)Configuration::get('PS_PRODUCTS_ORDER_WAY')], // Deprecated: orderwayposition
			'orderwaydefault' => $order_way_values[(int)Configuration::get('PS_PRODUCTS_ORDER_WAY')],
			'stock_management' => (int)$stock_management));

}

  And then

if (somethign to reference a list of category ids){	
	$pagination_infos = array(
			'products_per_page' => 50,
			'pages_nb' => $pages_nb,
			'p' => $this->p,
			'n' => $this->n,
			'nArray' => $nArray,
			'range' => $range,
			'start' => $start,
			'stop' => $stop,
			'current_url' => $current_url
		);

}else {
	$pagination_infos = array(
			'products_per_page' => (int)Configuration::get('PS_PRODUCTS_PER_PAGE'),
			'pages_nb' => $pages_nb,
			'p' => $this->p,
			'n' => $this->n,
			'nArray' => $nArray,
			'range' => $range,
			'start' => $start,
			'stop' => $stop,
			'current_url' => $current_url
		);

}

Or is that all very messy?  I have changed my mind about listing ALL the products, just perhaps adding high number instead.

 

The reason I need this is that I have set up a product a-z category, with subcats of a-e, f-j, etc and so regardless of the usual sort order, they MUST be listed A-Z.  I also thought that listing more products per page would be useful as otherwise it makes the category no easier to look though to find what you want than any other!

Link to comment
Share on other sites

it will not be as easy as it seems.

copy contents of category controller (init function) to cms controller (also init function)

remember that you have to change things like id of category (because in category controller id of category is a part of $_GET variables)

 

Seems we replied at the same time .... I'm afraid you have completely lost me now!  I don't understand why I need to move functions to the CMS controller to achieve this.   I assumed I would need to change the functions in the files they are currently (as above)

Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...