DGDeveloper Posted January 21, 2015 Share Posted January 21, 2015 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 More sharing options...
vekia Posted January 21, 2015 Share Posted January 21, 2015 jeszcze powiedz o jakiej wersji prestashop mówisz Link to comment Share on other sites More sharing options...
DGDeveloper Posted January 21, 2015 Author Share Posted January 21, 2015 1.5.x.x nie pamiętam teraz dokładnie a teraz nie mam dostępu bo do zadanie w pracy Link to comment Share on other sites More sharing options...
vekia Posted January 21, 2015 Share Posted January 21, 2015 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 More sharing options...
DGDeveloper Posted January 21, 2015 Author Share Posted January 21, 2015 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 More sharing options...
vekia Posted January 21, 2015 Share Posted January 21, 2015 błąd poprawiłem kod. wszystko się zgadza tylko parametr drugi trzeba zmienić (zamiast p zmieniamy n) Link to comment Share on other sites More sharing options...
DGDeveloper Posted January 22, 2015 Author Share Posted January 22, 2015 Wszystko działa. Słuchaj jesteś MISTRZEM! Link to comment Share on other sites More sharing options...
vekia Posted January 22, 2015 Share Posted January 22, 2015 super ;-) dzięki za potwierdzenia działania modyfikacji pozdrawiam, MIłosz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now