| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Change how products in the product list display in home_main.tpl for one category | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Change how products in the product list display in home_main.tpl for one category
I am about to introduce a new product to my website - downloadable cds - and I would like to change how these products in the product list display in home_main.tpl when this one category is selected.
My website does not use the product details page it just lists the products in each category when it selected. This is fine for the products we currently sell as their layout is the same, but now we need a new display for the new category of product. I know this mod can be done for product.tpl but as I do not use the details page, I think I need a duplicate products.tpl. Does anyone know how to achieve this process? I have literally pulled my hair out changing and guessing code and any help would be greatly appreciated. I know it has soemthing to do with else/if arguements in home_main.tpl but I do not know enough code to achieve it. I also think I will need duplicated & renamed .tpl's to call but again - not entirely sure. PLEASE HELP ME!!!!
__________________
xcartgold 4.5.4 xcartgold 4.5.5 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Change how products in the product list display in home_main.tpl for one category
If you want multiple categories with different layouts using different templates, we create a mod to create different template layouts and apply them to a category via the admin interface, and have a similar mod for product page display. Sample templates are also provided:
Multiple Category (Product Listing) Templates http://www.websitecm.com/x-cart-mods/multiple-product-listing-templates-for-xcart.html Multiple Product Page Templates http://www.websitecm.com/x-cart-mods/multiple-product-templates.html Package http://www.websitecm.com/x-cart-mods/multiple-product-templates-package-for-xcart.html If you need the one category only, then you can edit products.tpl and implement the following change: FIND: Code:
Change to: Code:
Of course substitute your categoryid for X and use the name and location of your custom template. You can download products.tpl, rename it to products_custom.tpl and edit it. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Change how products in the product list display in home_main.tpl for one category
Thanks so much for your help. I will have a go at the single category for now but just out of interest are all the template mods you provide 4.1.2 and up compatible? I may wish to buy them if I decide to have multiple category changes.
You have been so helpful. I await your response regarding the mod. UPDATE: I have now implemented this mod successfully and would like to know how I could make the search_result.tpl show the in same format as the category listing. I noted that it uses products.tpl as an include - could I add code to search_result.tpl that would use my custom products.tpl aswell?
__________________
xcartgold 4.5.4 xcartgold 4.5.5 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Change how products in the product list display in home_main.tpl for one category
Yes the mods are 4.1.x compatible.
You can edit your search result template and replace "products.tpl" with your template name. |
|||||||||
#5
|
|||||||
|
|||||||
Re: Change how products in the product list display in home_main.tpl for one category
Thanks for replying. I think you may have misunderstood what I meant or I have not made it very clear. I would like search_result.tpl to show either products.tpl OR products_cd.tpl (custom tpl). I would like results from my parent category no.158 to display products_cd.tpl and all the other products can display products.tpl. Is this possible?
I am assuming you can use a similiar code as you instructed me to place in products.tpl but I would appreciate if you could help me implement the above. Again, many thanks Jon
__________________
xcartgold 4.5.4 xcartgold 4.5.5 |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Change how products in the product list display in home_main.tpl for one category
That's a bit more difficult as the search results are not grouped by specific category, so you'd have mixed results. For that purpose you would have to modify the one template for both purposes, to do something like:
{if $products[product].categoryid eq "X"}Show Category Specific Info{else}Show the default{/if} |
|||||||||
#7
|
|||||||
|
|||||||
Re: Change how products in the product list display in home_main.tpl for one category
Hi
I was just wondering if it was possible to have all subcategories under the main category use the products_cd.tpl not the standard products.tpl. I have only just realised if is displaying incorrectly. I am still no closer to doing the same with the search_results.tpl either. Please help - It would be greatly appreciated!!!
__________________
xcartgold 4.5.4 xcartgold 4.5.5 |
|||||||
|
|||
X-Cart forums © 2001-2020
|