In default_filter.php
it looks like you would add your
p.products_delivery (assuming it is in the products table)
to the "select" list in line 27:
PHP Code:
// We are asked to show only a specific category
$listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, 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
and the same way in line 42:
PHP Code:
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, 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
Alternatively, you might need to add your field to the $select_column_list variable built in
/includes/modules/pages/index/main_template_vars.php around line 157. This looks like it also requires some prep work, adding to $define_list above it:
PHP Code:
// create column list
$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_IMAGE' => PRODUCT_LIST_IMAGE);
/* ,
'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
*/
asort($define_list);
reset($define_list);
$column_list = array();
foreach ($define_list as $key => $value)
{
if ($value > 0) $column_list[] = $key;
}
$select_column_list = '';
for ($i=0, $n=sizeof($column_list); $i<$n; $i++)
{
switch ($column_list[$i])
{
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_WEIGHT':
$select_column_list .= 'p.products_weight, ';
break;
}
}
Something like
'PRODUCT_LIST_DELIVERY' => PRODUCT_LIST_DELIVERY
where PRODUCT_LIST_DELIVERY is a constant defined by you in a similar way as the other constants in that list. This will require some research to find where those constants are defined and what they say. It probably also gets deeper into setting up a switch in admin to set the sort/display order of the new field, assuming you want to be able to control the behavior of the new field in the product listing.
If you can just piggyback the new field onto another field so it always displays with it, you can probably avoid this work.
Something like
PHP Code:
case 'PRODUCT_LIST_WEIGHT':
$select_column_list .= 'p.products_weight, ';
$select_column_list .= 'p.products_delivery, ';
break;
if you want the weight and delivery to show together.
I'm sure there is more involved in this whole process, but that's all I have time to look into right now.
Bookmarks