Hi,
As has been pointed, things are more complex than that, there is not such thing as "one file to control them all" here
But i can give you some hints and tips:
-
Use hooks and filters to add new rows to Listing viewsThis I'm using to add a new column "Premium type" (for a site with several types, a new DB table storing premiums and their data has been created)
function premiumType_header($table) {
$table->addColumn('premium_type', '<span>' . __('Premium type' . '</span>'));
}
function premiumType_data($row, $aRow) {
$conn = getConnection();
$premium = $conn->osc_dbFetchResult("SELECT premium_type FROM krw_premium_ads WHERE premium_id = '%d'", $aRow['pk_i_id'] );
$row['premium_type'] = $premium['premium_type'] ;
return $row ;
}
osc_add_hook('admin_items_table', 'premiumType_header');
osc_add_filter("items_processing_row", "premiumType_data" );
There you can see a quick method to
make your own queries to the database:
$conn = getConnection();
$premium = $conn->osc_dbFetchResult("SELECT premium_type FROM krw_premium_ads WHERE premium_id = '%d'", $aRow['pk_i_id'] );
a.- osc_dbFetchResult is for a single result expected, osc_dbFetchResults for several rows, etc. See
oc-includes/osclass/db.php for functions to UPDATE, INSERT, etc.
b.- They use same model as PHP core function
sprintfAnother filter to add options to "See more..." link for each item in the Listings view:
osc_add_filter('more_actions_manage_items', 'ptm_admin_premium_options');
Dig into
oc-includes/osclass/classes/datatables/ItemsDataTable.php for examples of filtering and available filters.
For other features you want, study existent plugins providing features similar of those you want to have.
Regards