View Issue Details

IDProjectCategoryView StatusLast Update
0005464OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2022-02-01 18:30
Reporterernestas.poskus Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status confirmedResolutionopen 
Product Version4.7.8 / 5.0.8 
Summary0005464: Set initial ordering for categories - sort keys
Description    /**
     * Used for setting session variable `aSorting` - (sort_key and sort_direction)
     *
     * default: sort key = oxtitle & sort direction = asc
     *
     * @param string $sSortKey
     * @param string $sortDir
     */
    public function setInitialSorting( $sSortKey = 'oxtitle', $sortDir = 'asc' )
    {
        $aCustomSort = array(
            'alist' => array(
                'sortby' => $sSortKey,
                'sortdir' => $sortDir,
            )
        );

        if ( !oxRegistry::getSession()->getVariable( 'aSorting' ) ) {

            /**
             * Set Session Variables
             */
            oxRegistry::getSession()->setVariable( 'aSorting', $aCustomSort );
        }

    }
Steps To ReproduceController = alist

insert function _setInitialSorting - into __constructor()
Additional InformationSets custom session sort key before everything loads
TagsNo tags attached.
Attached Files
for_example.png (2,707 bytes)   
for_example.png (2,707 bytes)   
ThemeNot defined
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Activities

svetlana

2014-03-28 10:04

reporter   ~0009740

waiting for the PO decision.

SvenBrunk

2022-01-31 13:37

administrator   ~0013598

Actually the default sorting for each category is the one that can be set in the admin (using oxsort keys).
It might be useful for various shop owners though to either reset this to a certain key or in general set it to one of the preset keys and directions.

SvenBrunk

2022-02-01 14:45

administrator   ~0013664

Unfortunately this is a bit difficult as the sortings in the frontend relate to theme settings while the categories have their own settings. So doing this would need a rewrite of the theme