AFemaleProdigy Posted October 17, 2012 Share Posted October 17, 2012 (edited) I have created a custom product list via categories in 1.4.7.3. I am using a conditional statement to limit the items that display to those with less than 5 items in stock. The problem I am having is that even though the conditional statement is working, pagination appears to still be counting all items, not just the ones with less than 5 stock. So I end up with only one or two items per page and multiple pages. Anyone know how I can make the pagination count the products correctly? You can see what I mean here... http://rotmgvault.co...47&noredirect=1 Edited October 18, 2012 by AFemaleProdigy (see edit history) Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted October 18, 2012 Author Share Posted October 18, 2012 I found this in the controller and am guessing that I need to make an edited version to include the "stock less than" part. Any ideas how to do that? if(!$hookExecuted) // The hook was not executed, standard working { self::$smarty->assign('categoryNameComplement', ''); $this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); $this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts" $this->cat_products = $this->category->getProducts((int)(self::$cookie->id_lang), (int)($this->p), (int)($this->n), $this->orderBy, $this->orderWay); } else // Hook executed, use the override $this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts" self::$smarty->assign('nb_products', (int)$this->nbProducts); } Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted October 18, 2012 Author Share Posted October 18, 2012 If not one knows how to modify it, is there a way to not use pagination at all on my custom page? I tried removing the include url, but all that did was remove the links, but did not display the full list of items. It was still sorting. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted October 20, 2012 Author Share Posted October 20, 2012 Is everyone on vacation lately or what? Seems like hardly anyone is contributing advise. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted October 28, 2012 Author Share Posted October 28, 2012 Still no replies. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted November 5, 2012 Author Share Posted November 5, 2012 Help please? Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 7, 2012 Share Posted November 7, 2012 Hi, where are you get the new collection (with condition "stock less than")? You also need to modificate $this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); so that it returns number of products in new collection (with condition "stock less than") Regards Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted November 12, 2012 Author Share Posted November 12, 2012 Hi, where are you get the new collection (with condition "stock less than")? You also need to modificate $this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); so that it returns number of products in new collection (with condition "stock less than") Regards I don't quite understand your instructions. Can you explain a little more? Sorry and thanks. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted January 5, 2013 Author Share Posted January 5, 2013 Hi, where are you get the new collection (with condition "stock less than")? You also need to modificate $this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); so that it returns number of products in new collection (with condition "stock less than") Regards I don't know how to make this work. Can you or someone please help me? I see the code you are talking about, but am not sure what to change. 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