Jump to content

Ilość produktów wyświetlanych na stronie w danej kategorii


DGDeveloper

Recommended Posts

Witam, Słuchajcie męczę się z tym już z tym problemem jakiś czas i nie wiem jak to ogarnąć. Jak i co przerobić żeby np w kategorii o ID=120 na stronie wyświetlało się 100 produktów a w kategorii o ID=60 wyświetlało się 60 produktów. Nie musi być to edytowalne w panelu wystarczy że uda mi się jakiego  if'a wstawić. Próbowałem przerobić pagination.php ale to mi się nie udało :(  Błagam pomóżcie. 

Link to comment
Share on other sites

controllers/CategoryController.php

jest tam linia:

$this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay);

zmieniamy na:

if ($this->category->id == 5){
$this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, 120, $this->orderBy, $this->orderWay);
} elseif ($this->category->id ==6 ) {
$this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, 125, $this->orderBy, $this->orderWay);
} elseif ($this->category->id == 7) {
$this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, 135, $this->orderBy, $this->orderWay);
} else {
$this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, 145, $this->orderBy, $this->orderWay);
}
Link to comment
Share on other sites

Rozumiem że jak chce wyświetlić w kategorii o ID=120 200 produktów to wstawiam 

if ($this->category->id == 120){

$this->cat_products = $this->category->getProducts($this->context->language->id, 200, (int)$this->n, $this->orderBy, $this->orderWay);

Dobrze myśle?

Link to comment
Share on other sites

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