product_listing.php & product_listing_col.php Should Be Combined

Description

Been doing some work involving product_listing.php & product_listing_col.php and noticed each of these files share the majority of their code.

To make maintaining/modding easier I have combined the two modules (and attached the result to this report).

The following changed are also required;
Open /catalog/templates/<your_template>/content/index_products.tpl.php and /catalog/templates/<your_template>/content/advanced_search-result.tpl.php
Find near the end of each document;
// initial set from admin
if ( (!isset($_GET['gridlist'])) && (!isset($_SESSION['gridlist'])) ) {
if (PRODUCT_LIST_TYPE == 0) { $gridlist = 'list'; } else { $gridlist = 'grid'; }
}

// current request
if (isset($_GET['gridlist'])) { $gridlist = $_GET['gridlist']; }

// previous request
if (isset($_SESSION['gridlist'])) { $gridlist = $_SESSION['gridlist']; }

if ($gridlist == 'list') {
include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
} else {
include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_COL);
}
Replace all that with;
include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);

The following changed are also recommended;
In /catalog/includes/filenames.php remove the following line;
define('FILENAME_PRODUCT_LISTING_COL', 'product_listing_col.php');
Delete /catalog/includes/modules/product_listing_col.php

Environment

None

Steps to reproduce

None

Status

Assignee

Giles Marshall

Reporter

Scott Murphy

Labels

None

Severity

Tweak

Components

Fix versions

Affects versions

v2.5.2

Priority

Configure