Display Product Attributes in Category Page


https://forum.kartris.com/Topic6417.aspx
Print Topic | Close Window

By JOHN HALITZOGLOU - Fri 26 Feb 2016
In the page of category which appear all products i would like display attributes next to the product (features like author, isbn, pages etc.)
Ηow I can do this?
By Tiggywiggler - Sun 1 May 2016
First you need to know what template your category view is using.

If you go into the admin section and 'Edit' your category you will see an option for [Product Display Type]. You then need to find the Product View Template for that 'Product Display Type'.

For example, if the [Product Display Type] was "Extended", then you need to find the "Extended Product Template". This can be found at ~/UserControls/Templates/ProductTemplateExtended.ascx.

You can now either (1) add the details you want to this template, or, (2) copy this template into a new template and then add the details you want to the new template. You will need to know how to code to do this, but isn't that the point of open source! Smile

In this example I would add your extra data in the marked location:

<p class="description">
<asp:Literal ID="litProductDesc" runat="server" Text='<%# CkartrisDisplayFunctions.TruncateDescription(Eval("P_Desc"), KartSettingsManager.GetKartConfig("frontend.products.display.truncatedescription")) %>'></asp:Literal></p>

ADD YOUR NEW INFORMATION HERE

<asp:HyperLink ID="lnknMore" runat="server" NavigateUrl='<%# Eval("P_ID", "~/Product.aspx?ProductID={0}") %>'

Now, there is the obvious question of where are you going to get that data? Are you going to add it to the database, pull it from an existing data base field, or reach outside of the website to get it from another source, however, you will need to work that one out.

Adding a new field to the SQL Server database and then linking it to the fields is not a simple process and would be beyond the scope of a forum post.