Jump to content

[SOLVED] Put category on homepage?


Guest

Recommended Posts

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 by Guest (see edit history)
Link to comment
Share on other sites

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

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

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

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

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

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

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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

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 by iliasiovis (see edit history)
Link to comment
Share on other sites

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

  • 3 months later...

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 by ajnglagla (see edit history)
Link to comment
Share on other sites

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

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

  • 3 months later...
  • 2 weeks later...

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 by belilan (see edit history)
Link to comment
Share on other sites

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

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