Willie Theron Posted April 26, 2012 Share Posted April 26, 2012 Greetings I have a technical question. I have an novice understanding about php programing and know a little bit about prestashop's design structure. My situation is. I have a category called Recomended products. Is it possible to make that one category look different then the other category pages? like adding ratings, and a bigger description and so on. Or alternatively is the only option(And fastest one) to hook a product module to the home page and modify that? Hope someone can help in this. Link to comment Share on other sites More sharing options...
CartExpert.net Posted April 26, 2012 Share Posted April 26, 2012 Hi, Hooking a module to the home page will not work for what you need. However you can use different tpl for that category. Link to comment Share on other sites More sharing options...
Willie Theron Posted April 26, 2012 Author Share Posted April 26, 2012 Okay, can you maby direct me to a guide maby on how I will be able to do that? Link to comment Share on other sites More sharing options...
noesac Posted April 26, 2012 Share Posted April 26, 2012 ok here's what I tried (but didn't work): I created a clone of product-list.php, and changed the file name from product-list.php to my-new-page.php Within my-new-page.php I changed the reference to product-list.tpl to my-new-page.tpl Then I created a clone of product-list.tpl, and renamed it my-new-page.tpl So far so good. The page works. Then in my-new-page.tpl, I added the following IF statement to the top: {if $id_category->id == 123} ....but that didn't work. The page now displays blank. Any ideas? Link to comment Share on other sites More sharing options...
Willie Theron Posted April 26, 2012 Author Share Posted April 26, 2012 That makes sense. a category(Pagelink) condition in a if statement and editing the product list.tpl could work. But rewriting prestashop in this way only for this one little thing... I dont think its worth it. I heard something about using a .tpl file earlier. You know when a client asks something you normally want to give it to them, But chances are this will do more harm then good... But definately doable. Thank you for mentioning the condition thing, (Back to basics) Must add, Prestashop is legend. Love the software. so my theory: 1 add a query to read page, 2 test that in a if categoryX, then special else normal.... 3 modify the Product-list.tpl first part for the "Special" Products Doesnt look too hard from a theoretical aspect. Thanx for the Idea, I will sleep on wheather or not I want to attempt this. Link to comment Share on other sites More sharing options...
Willie Theron Posted April 26, 2012 Author Share Posted April 26, 2012 for those of you who might be confused, I kinda had a conversation with myself now to sort out the problem and just wana share incase this blabering can help someone else. Link to comment Share on other sites More sharing options...
lain Posted August 18, 2012 Share Posted August 18, 2012 that worked for me: 1- in category.tpl after those lines: {if isset($category)} {if $category->id AND $category->acoutive} add {if $category->id == 3} (where 3 is the your custom category) then put your own code, to try if it works copy and paste the default category.tpl code from where you writed the if condition to here (not included): {elseif $category->id} <p class="warning">{l s='This category is currently unavailable.'}</p> {/if} {/if} and then the condition end {/if} now in the code you copied to try if it works dont forget to change the includes: {include file="$tpl_dir./product-compare.tpl"} {include file="$tpl_dir./product-sort.tpl"} {include file="$tpl_dir./product-list.tpl" products=$products} {include file="$tpl_dir./product-compare.tpl"} {include file="$tpl_dir./pagination.tpl"} change the product-list.tpl to product-list-new-category.tpl. Now make a copy of your product-list.tpl in the folder themes/yourtheme and rename it to product-list-new-category.tpl now you can customize that category making changes on product-list-new-category.tpl and dont forget to edit product_list.css if you want to change the styles too. 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