[eluser]mohfeza code ignitor[/eluser]
Please let me know how i can write the following line of code with loading config item--
foreach ($arModeSortType[$sCurrentMode] as $sModeSortType => $sDisplay) {
I tried the following line of code, but it's not working-
foreach ($this->config->item('arModeSortType[$this->config->item("sCurrentMode")]') as $sModeSortType => $sDisplay) {
In autoloaded config file contains-
$config['sCurrentMode'] = 'books';
// Sort Types
$config['arModeSortType'] = array (
'baby' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
),
'books' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+reviewrank' => 'Average Customer Review',
'+pricerank' => 'Price (Low to High)',
'+inverse-pricerank' => 'Price (High to Low)',
'+daterank' => 'Publication Date',
'+titlerank' => 'Alphabetical (A-Z)',
'-titlerank' => 'Alphabetical (Z-A)',
),
'classical' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
),
'dvd' => array(
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical',
),
'electronics' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical',
'+reviewrank' => 'Review',
),
'garden' => array(
'+psrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
'-titlerank' => 'Alphabetical (Z-A)',
'+manufactrank' => 'Manufacturer (A-Z)',
'-manufactrank' => 'Manufacturer (Z-A)',
'+price' => 'Price (Low to High)',
'-price' => 'Price (High to Low)',
),
'kitchen' => array(
'+psrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
'-titlerank' => 'Alphabetical (Z-A)',
'+manufactrank' => 'Manufacturer (A-Z)',
'-manufactrank' => 'Manufacturer (Z-A)',
'+price' => 'Price (Low to High)',
'-price' => 'Price (High to Low)',
),
'magazines' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
),
'music' => array(
'+psrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+artistrank' => 'Artist Name',
'+orig-rel-date' => 'Original Release Date',
'+titlerank' => 'Alphabetical',
),
'pc-hardware' => array(
'+psrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
'-titlerank' => 'Alphabetical (Z-A)',
),
'photo' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
'-titlerank' => 'Alphabetical (Z-A)',
),
'software' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical',
'+price' => 'Price (Low to High)',
'+price' => 'Price (High to Low)',
),
'toys' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
),
'universal' => array(
'+psrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical (A-Z)',
'-titlerank' => 'Alphabetical (Z-A)',
'+manufactrank' => 'Manufacturer (A-Z)',
'-manufactrank' => 'Manufacturer (Z-A)',
'+price' => 'Price (Low to High)',
'-price' => 'Price (High to Low)',
),
'vhs' => array(
'+psrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical',
),
'videogames' => array(
'+pmrank' => 'Featured Items',
'+salesrank' => 'Bestselling',
'+titlerank' => 'Alphabetical',
'+price' => 'Price (Low to High)',
'-price' => 'Price (High to Low)',
),
);