Guest Posted August 18, 2013 Share Posted August 18, 2013 (edited) Hey guys, I'm trying to add a category to the homepage basically as a hook. What is the best way to go about this? I tried a couple solutions on the forums but none were what I was looking for. The reason I want a category instead of homefeatured is because I wanted pagination and I figured this is the easiest route as I have already addd infinite scrolling to pagination.tpl. Thanks in advance! eggo Edited August 25, 2013 by Guest (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 18, 2013 Share Posted August 18, 2013 the main problem in this case is fact, that "categories" feature isn't using any hook. Categories page is a controller, so in this case you should use categories controller instead the homepage controller. Link to comment Share on other sites More sharing options...
Guest Posted August 18, 2013 Share Posted August 18, 2013 Hey vekia, Thanks for the response. Do you think I should redirect my homepage to the controller? Is there anyway I can have that page appear as the homepage www.mydomain.com? I want it to be the first page seen. Thanks! eggo Link to comment Share on other sites More sharing options...
Guest Posted August 21, 2013 Share Posted August 21, 2013 Bump, I don't usually do this but I can't really find anything on how I would go about doing this or maybe it is not possible? Thanks in advance, eggo Link to comment Share on other sites More sharing options...
PascalVG Posted August 21, 2013 Share Posted August 21, 2013 The reason I want a category instead of homefeatured is because I wanted pagination and I figured this is the easiest route as I have already addd infinite scrolling to pagination.tpl. Hi rofl, I'm not sure I exactly understand your case. You talk about 'a' category on the homepage, 'to get pagination'. What exactly do you want to get paginated here? The products in that category in a paginated way, with layout like the homefeatured module? (i.e. in short : homefeatured with pagination option?) Please elaborate a little, so that I get the point correctly. Thx, pascal Link to comment Share on other sites More sharing options...
Guest Posted August 21, 2013 Share Posted August 21, 2013 Hey Pascal, Thanks for responding. I want a specific category of my choice to BE the homepage, the first thing the user sees, but I don't want a redirect to another URL for simplicity reasons and also SEO reasons. I would use the homefeatured module but there is no pagination and I needed pagination to add a jQuery infinite scroll, which I have already done for the categories. Thanks Pascal, the help is much appreciated. Best, eggo Link to comment Share on other sites More sharing options...
Guest Posted August 23, 2013 Share Posted August 23, 2013 Okay, if this is not possible, is it a tough venture to add pagination to the home featured module? Thanks! eggo Link to comment Share on other sites More sharing options...
PascalVG Posted August 23, 2013 Share Posted August 23, 2013 Hi rofl, I couldn't think of any way to make it work yet. Will have alook tonight. If not, I will check how much work it takes for pagination. "I'll be back" pascal Link to comment Share on other sites More sharing options...
Guest Posted August 23, 2013 Share Posted August 23, 2013 Thanks Pascal, your the man! Really appreciate it. All the best, eggo Link to comment Share on other sites More sharing options...
PascalVG Posted August 24, 2013 Share Posted August 24, 2013 Hi rofl, I checked the sources, played with it, but it's really not so easy I believe. Both ways have their own problems. As Vekia said, the controller cannot be hooked into the front page, the featured products are hard to paginate. The only way to do it is a redirect, but you don't want that you said... Did you search for any featured products like module that has pagination in it already? I don't see any quick solution to build this. Anyone? My 2 cents, pascal Link to comment Share on other sites More sharing options...
Guest Posted August 24, 2013 Share Posted August 24, 2013 Hey Pascal, Thanks for looking into that for me. I suspected this might be the issue as I have been looking into it for quite some time now. Is there any way for me to copy the CategoryController into homefeatured.php and the category.tpl file into homefeatured.tpl with a few changes? Also I found this solution for adding pagination to homefeatured for 1.5.3.1, I am using 1.5.4.1 and I can't get it to work, maybe there is a small problem with it I am missing? http://www.prestashop.com/forums/index.php?/topic/102694-homefeatured-pagination/page__view__findpost__p__1156638 Thanks for the help Pascal, it is much appreciated. Link to comment Share on other sites More sharing options...
PascalVG Posted August 25, 2013 Share Posted August 25, 2013 Hi rofl, I looked at the topic you gave and added the changes in 1.5.4.1. It does something like pagination, but still has an error when going to page 2 (I have only so many products in my testshop to fill about 2 pages, so it's the last page as well) Maybe try and play with it a little and see what it does in your place. Please backup first: /modules/homefeatured/homefeatured.php /themes/<your theme folder>/modules/homefeatured/homefeatured.tpl Then upload attached file homefeatured.php onto /modules/homefeatured/homefeatured.php (overwriting the just backed-up file) Then upload attached file homefeatured.tpl onto /themes/<your theme folder>/modules/homefeatured/homefeatured.tpl (overwriting the just backed-up file) Finally upload attached file paginationHomeFeatured.tpl onto /themes/<your theme folder>/modules/homefeatured/paginationHomeFeatured.tpl (new file) when done, reload front page. (The Previous/1/2/Next buttons show messy still, that's layout work and not yet important for now. First make it work) Have a look at it and see how it works for you... pascal homefeatured_mod1541_pagination_tryout1.zip 1 Link to comment Share on other sites More sharing options...
Guest Posted August 25, 2013 Share Posted August 25, 2013 Hey Pascal, Thanks so much for the help! I didn't realize I needed the php changes from the first post, stupid me. Anyways It works! And perfectly with the AJAX infinite scroll I added with a few div changes. Your the man Pascal, thanks so much for the help! Link to comment Share on other sites More sharing options...
PascalVG Posted August 26, 2013 Share Posted August 26, 2013 Hi eggo, glad it worked! Great that you found that other topic. Credits go to them! Happy selling! pascal Link to comment Share on other sites More sharing options...
iliasiovis Posted August 29, 2013 Share Posted August 29, 2013 (edited) Hello and thank you for the modifications. aparently the links go to /index.php?p=2 etc which gives me a page-not-found error. I am currently running PS 1.5.2 yet the mods all work correctly except the 404 error. Any ideas on how to fix it Thank you! Edit: so.. if I type the link without the index.php then it seems to be working greatly! I hope to just remove the "index.php" from all the links in the paginationHomeFeatured.tpl Thanks again Edited August 29, 2013 by iliasiovis (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted August 29, 2013 Share Posted August 29, 2013 Hi Ilias, edit the file paginationHomeFeatured.tpl: at the beginning of the file, remove red text: * @author PrestaShop SA <[email protected]> * @copyright 2007-2012 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} {if isset($no_follow) AND $no_follow} {assign var='no_follow_text' value='rel="nofollow"'} {else} {assign var='no_follow_text' value=''} {/if} {if isset($p) AND $p} {assign var='requestPage' value=$base_dir|cat:'index.php'} {assign var='requestNb' value=$base_dir|cat:'index.php'} so that you get: {assign var='requestPage' value=$base_dir} {assign var='requestNb' value=$base_dir} That should do it! pascal Link to comment Share on other sites More sharing options...
skal16 Posted September 1, 2013 Share Posted September 1, 2013 Hello how can we change the number of displayed product in a page ? Wich is the variable ? Thanks Link to comment Share on other sites More sharing options...
vekia Posted September 1, 2013 Share Posted September 1, 2013 Hello how can we change the number of displayed product in a page ? Wich is the variable ? Thanks but you're talking about homepage products ? (featured products) or about products in categories? can you shed some light on this? Link to comment Share on other sites More sharing options...
ajnglagla Posted December 5, 2013 Share Posted December 5, 2013 (edited) Hi rofl, I looked at the topic you gave and added the changes in 1.5.4.1. It does something like pagination, but still has an error when going to page 2 (I have only so many products in my testshop to fill about 2 pages, so it's the last page as well) Maybe try and play with it a little and see what it does in your place. Please backup first: /modules/homefeatured/homefeatured.php /themes/<your theme folder>/modules/homefeatured/homefeatured.tpl Then upload attached file homefeatured.php onto /modules/homefeatured/homefeatured.php (overwriting the just backed-up file) Then upload attached file homefeatured.tpl onto /themes/<your theme folder>/modules/homefeatured/homefeatured.tpl (overwriting the just backed-up file) Finally upload attached file paginationHomeFeatured.tpl onto /themes/<your theme folder>/modules/homefeatured/paginationHomeFeatured.tpl (new file) when done, reload front page. (The Previous/1/2/Next buttons show messy still, that's layout work and not yet important for now. First make it work) Have a look at it and see how it works for you... pascal Thank you PascalVG! This code works perfect! Edited December 5, 2013 by ajnglagla (see edit history) Link to comment Share on other sites More sharing options...
ajnglagla Posted December 5, 2013 Share Posted December 5, 2013 Hey Pascal, Thanks so much for the help! I didn't realize I needed the php changes from the first post, stupid me. Anyways It works! And perfectly with the AJAX infinite scroll I added with a few div changes. Your the man Pascal, thanks so much for the help! I know its out of the subject but i am tyring to make a AJAX infinite scroll too. I learn that i had to add a pagination. But my pagination works great thanks to PascalVG. Is that possible you share how do you make AJAX infinite scroll please? Link to comment Share on other sites More sharing options...
Guest Posted December 5, 2013 Share Posted December 5, 2013 Hey ajn, In order to use infinite scroll I used this plugin on GitHub. https://github.com/webcreate/infinite-ajax-scroll You need to wrap your product list in the #container div, and the .item class to the div for each product, add #pagination to the pagination div and the .next class to the next button. Good luck. If your having specific troubles let me know and I can try to shine some light! eggo Link to comment Share on other sites More sharing options...
ajnglagla Posted December 5, 2013 Share Posted December 5, 2013 Ohh ) Thats great. thank you rolfmyeggo. Just 2 min before you sent i have bought a infinitive loading module, and it does not work. I feel terrible Wanna kill myself Link to comment Share on other sites More sharing options...
ajnglagla Posted December 5, 2013 Share Posted December 5, 2013 But your explanation may really help me. I will try to check classes.. thank you so much. Link to comment Share on other sites More sharing options...
shampresta Posted March 21, 2014 Share Posted March 21, 2014 The pagination works great... thanks you very much Link to comment Share on other sites More sharing options...
belilan Posted April 3, 2014 Share Posted April 3, 2014 (edited) hi, I am a little bit lost. I have installed a nice module(infiniteajax) to have infinite scroll, and its working fine on all pages but it's not working with the homefeatured items. could someone resume how to make it work on homefeatured items as well please? thanks. Edited April 3, 2014 by belilan (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted April 3, 2014 Share Posted April 3, 2014 belilan, Better start a new topic, as the problem you have is not (directly?) connected to the topic discussed here, AND this topic is marked as solved, so not as many people will have a look at it as a non solved one would. So start a new topic in the right subforum (Depending on the exact problem either General or Development would probably be the best in this case) and describe what exactly isn't working, and add a link to your site, the PS version you use, maybe a link where to get the module (is it a free one??), module version etc. Anything that may facilitate finding a solution. pascal. P.S. message me a link to the newly created topic, and I will have a look at it (I don't say I can solve it though... :-) ) Link to comment Share on other sites More sharing options...
vegaskev Posted June 27, 2014 Share Posted June 27, 2014 Wondering if anyone has been able to make pagination work on featured home module for Prestashop 1.6+. 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