Many thanks for help.
But not sure where to place that code and which line. I that gonne be default_filter.php or maybe other?
Printable View
Many thanks for help.
But not sure where to place that code and which line. I that gonne be default_filter.php or maybe other?
tpl_product_info_display.php would be where I'd start. or try the product_listings file (forget its proper name). of course it depends upon on how you're setting up you're store. regardless, this piece of code goes in an html section.
please help me
I got this great mod going without a hitch, took about an hour to get right. I do have one question tho:
How can I display my custom fields in the product listing pages such as featured products, and categories? I also need to be able to sort by these custom settings.
Any help would be appreciated, and my hat's off to crazy for such a well described mod!:bigups:
Zep, look at the last post of page 7 of this thread and mimic that code snippet (or wherever in this thread the echo statement is discussed. The feature product listing page is:
\includes\templates\template_default\templates\tpl_featured_products_default.php .
Not sure about categories but I think works off of product_listing file in the same directory or tpl_modules_product_listing.php. I forget.
If you need search capability, there's a link in another post of mine on page 7. Let me know if that's incomplete because I've got pretty comprehensive instructions for the admin side of things, too. I just haven't made the time to "anonymize" them.
I am assuming that by sort you mean, "Filter By:" which is what I want to eventually add to all my product listing pages. The default_filter.php file in includes\index_filters\ may affect sort, too. But it'll be awhile before I get to it myself.
Hi Zep
Have you managed to display extra fields in product detail view?
If yes I will tell you how to display them in product list, but displaing fields in detail view is a first step to display them in list.
Thanks for the tips, but this issue is confusing me...
I change tpl_modules_featured_products.php, and my text displays fine. But the new fields do not display. do I need to include one of the other php files? I tried putting the info into variables, then placing them after the price, that does not work either :frusty:
the code I am using is something like this:
$case =$product_info->fields['products_case'];
$indiv = $product_info->fields['products_indiv'];
then echoing like this:
<div class="p_left"><br style="line-height:9px;"/>Case Price: <a href="'.$href.'">'.$price.$case.$indiv.' </a>
Please help!
Thank you janekbar5 and cartguin, I really appreciate all the help.
I have successfully displayed the information in the single item view (product_info), but want to be able to display the info if someone goes to browse featured products, or a category as well.
I will also be making a drop down box to sort (my custom fields are numbers) from low to high, and vise versa - but I have not done my due diligence on that yet, I'm focusing on getting them displayed first:smile:baby steps...
Thanks in advance for pointing me in the right direction!
Hi
in my case I wanted to add about 20 extra fields to each product. I follow this post and with help of the guys I managed to do it. Fields are visible in product details. Then I wanted to to make them visible in category overview (products listing) and make them also sortable like other fields(weight, price, manufacturer...) I managed to achive that. so if you managed to display those
extra fields in product details you are in half way. Now if you want do show those fields in product listing you must modify those files:
-includes/languages/english/index.php
standard fields:
define('TABLE_HEADING_QUANTITY', 'Quantity');
define('TABLE_HEADING_PRICE', 'Price');
define('TABLE_HEADING_WEIGHT', 'Weight');
define('TABLE_HEADING_BUY_NOW', 'Buy Now');
my new fields
define('TABLE_HEADING_NORMDIN', 'Norm DIN');
define('TABLE_HEADING_THREADSIZE', 'Thread size');
define('TABLE_HEADING_SIZEA', 'A mm');
define('TABLE_HEADING_SIZEB', 'B mm');
define('TABLE_HEADING_SIZEC', 'C mm');
define('TABLE_HEADING_SIZED', 'D mm');
-includes/modules/product_listing.php
you have to include your extra fields
similar to those standard
line about 20
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
$lc_align = '';
$zc_col_count_description++;
break;
and the same in line about 580
case 'PRODUCT_LIST_QUANTITY':
$lc_align = 'right';
$lc_text = $listing->fields['products_quantity'];
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_align = 'right';
$lc_text = $listing->fields['products_weight'];
break;
case 'PRODUCT_LIST_NORMDIN':
if ($listing->fields['products_normdin']==0) {
//hide image column
$lc_text = '';
$lc_align = '';
} else {
//show image column
$lc_align = 'right';
$lc_text = $listing->fields['products_normdin'];
}
break;
case 'PRODUCT_LIST_THREADSIZE':
if ($listing->fields['products_threadsize']==0) {
//hide image column
$lc_text = '';
$lc_align = '';
} else {
//show image column
$lc_align = 'right';
$lc_text = $listing->fields['products_threadsize'];
}
break;
I got here extra condition if field is =0 field is not visible
includes/index_filters/default_filter.php
to add extra fields to sql querry like I did:
$listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1,
s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping,
p.products_qty_box_status, p.products_normdin, p.products_threadsize, p.products_sizeA, p.products_sizeB, p.products_sizeC, p.products_sizeD,
p.products_sizeD1, p.products_sizeD2, p.products_sizeE, p.products_sizeE1, p.products_sizeF, p.products_sizeG, p.products_sizeH, p.products_sizeW, p.products_sizeX, p.products_sizeQG, p.products_sizeQX, p.products_peld, p.products_pelld, p.products_pehd, p.products_pa66, p.products_tpe,
p.products_peeva, p.products_pvc, p.products_pelldwasher, p.products_pa66oring, p.products_pelduvtreatment, p.products_injectedhole,
p.products_pa66washer, p.products_pehdwasher, p.products_pipethread, p.products_oldrefrence
there are 4 blocks with that querry in this file line from 28 to 105
and line 136
you can see standard fields and my new:
case 'PRODUCT_LIST_QUANTITY':
$listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_IMAGE':
$listing_sql .= "pd.products_name";
break;
case 'PRODUCT_LIST_WEIGHT':
$listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_NORMDIN':
$listing_sql .= "p.products_normdin " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_THREADSIZE':
$listing_sql .= "p.products_threadsize " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
last file is:
includes/modules/pages/index/main_template_vars.php
line 138
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
'PRODUCT_LIST_NORMDIN' => PRODUCT_LIST_NORMDIN,
'PRODUCT_LIST_THREADSIZE' => PRODUCT_LIST_THREADSIZE,
'PRODUCT_LIST_SIZEA' => PRODUCT_LIST_SIZEA,
'PRODUCT_LIST_SIZEB' => PRODUCT_LIST_SIZEB,
'PRODUCT_LIST_SIZEC' => PRODUCT_LIST_SIZEC,
'PRODUCT_LIST_SIZED' => PRODUCT_LIST_SIZED,
'PRODUCT_LIST_SIZED1' => PRODUCT_LIST_SIZED1,
'PRODUCT_LIST_SIZED2' => PRODUCT_LIST_SIZED2,
'PRODUCT_LIST_SIZEE' => PRODUCT_LIST_SIZEE,
'PRODUCT_LIST_SIZEE1' => PRODUCT_LIST_SIZEE1,
'PRODUCT_LIST_SIZEF' => PRODUCT_LIST_SIZEF,
'PRODUCT_LIST_SIZEG' => PRODUCT_LIST_SIZEG,
'PRODUCT_LIST_SIZEH' => PRODUCT_LIST_SIZEH,
'PRODUCT_LIST_UVTREAT' => PRODUCT_LIST_UVTREAT,
'PRODUCT_LIST_INJECT' => PRODUCT_LIST_INJECT,
'PRODUCT_LIST_PA66WASH' => PRODUCT_LIST_PA66WASH,
'PRODUCT_LIST_PEHDWASH' => PRODUCT_LIST_PEHDWASH,
'PRODUCT_LIST_PIPETHREAD' => PRODUCT_LIST_PIPETHREAD,
'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);
and line 190
case 'PRODUCT_LIST_MODEL':
$select_column_list .= 'p.products_model, ';
break;
case 'PRODUCT_LIST_NAME':
$select_column_list .= 'pd.products_name, ';
break;
case 'PRODUCT_LIST_MANUFACTURER':
$select_column_list .= 'm.manufacturers_name, ';
break;
case 'PRODUCT_LIST_QUANTITY':
$select_column_list .= 'p.products_quantity, ';
break;
case 'PRODUCT_LIST_IMAGE':
$select_column_list .= 'p.products_image, ';
break;
case 'PRODUCT_LIST_NORMDIN':
$select_column_list .= 'p.products_normdin, ';
break;
case 'PRODUCT_LIST_THREADSIZE':
$select_column_list .= 'p.products_threadsize, ';
break;
case 'PRODUCT_LIST_SIZEA':
$select_column_list .= 'p.products_sizeA, ';
break;
case 'PRODUCT_LIST_SIZEB':
$select_column_list .= 'p.products_sizeB, ';
break;
case 'PRODUCT_LIST_SIZEC':
$select_column_list .= 'p.products_sizeC, ';
break;
case 'PRODUCT_LIST_SIZED':
$select_column_list .= 'p.products_sizeD, ';
break;
once you take a closer look you gonne now how to do it
I will try it out tomorrow, janekbar5 - I am eternally in your debt, thank you:wink: