Because this is driving me nuts ... let's try getting the products_viewed another way ...
Edit the file:
/includes/modules/pages/index/main_template_vars.php
and add the code in RED:
Code:
// always add quantity regardless of whether or not it is in the listing for add to cart buttons
if (PRODUCT_LIST_QUANTITY < 1) {
$select_column_list .= 'p.products_quantity, ';
}
// bof: force products_viewed
$select_column_list .= 'pd.products_viewed,';
// eof: force products_viewed
// set the product filters according to selected product type
Then in the file:
/includes/modules/your_templates_dir/products_listing.php
use this code for the Case:
Code:
case 'PRODUCT_LIST_MODEL':
$lc_align = '';
// $lc_text = $listing->fields['products_model'];
$lc_text = $listing->fields['products_model'] .
( $listing->fields['products_viewed'] > 0 ? '<li>' . 'Views: ' . $listing->fields['products_viewed'] . '</li>' : '') . '<br />';
break;
What this does is get the info from the database when all the other data is gathered so that the products_viewed is available like the other information in the listing ...
Bookmarks