Forums / General Questions / How to show Attributes such as size or name at Product listing page

How to show Attributes such as size or name at Product listing page

Locked

Started by onlyjf77 on 16 Oct 2009, 10:17 PM · Views: 834

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
16 Oct 2009, 10:17 PM
#1
onlyjf77 avatar

onlyjf77

New Zenner

Join Date:
Jun 2009
Posts:
4
Plugin Contributions:
0

How to show Attributes such as size or name at Product listing page

Hi.. I am just wondering that How to show Attributes such as size or name at Product listing page?

Is it possible?

16 Oct 2009, 10:23 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to show Attributes such as size or name at Product listing page

The tutorials/FAQ's link at the top of this page is a resource
I searched for "attributes"
https://www.zen-cart.com/tutorials/index.php?article=57

Zen-Venom Get Bitten

16 Oct 2009, 10:31 PM
#3
onlyjf77 avatar

onlyjf77

New Zenner

Join Date:
Jun 2009
Posts:
4
Plugin Contributions:
0

Re: How to show Attributes such as size or name at Product listing page

Thank you for your reply

but I mean Product listing page not product info page.

17 Oct 2009, 12:02 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: How to show Attributes such as size or name at Product listing page

The product attributes are not pulled from the database for the product listing (index) page, so there's code involved to get what you want. The files you'll need to mess with are:

  1. \includes\modules\YOURTEMPLATE\attributes.php
  2. \includes\templates\YOURTEMPLATE\templates\ tpl_modules_attributes.php
  3. \includes\templates\YOURTEMPLATE\templates \tpl_modules_product_listing.php
    The first file pulls the attributes from the database using $_GET['product_id'], but there's no product_id set when you're in the index page. You'll need a section that 'recognizes' that it's been called from the product index listing and return a requested product's attributes.

The second file formats the attributes for the product_info page, so you'll need to do something special for the product listing.

The third file actually formats the product listing page. It'll need to work in conjunction with the other 2 files to get the attributes into the mix.