Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

New sort option as default

   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
Thread Tools Search this Thread
Old 01-02-2024, 12:13 PM
Ed B. Ed B. is offline

Join Date: Apr 2016
Posts: 446

Default New sort option as default

This is a kind of follow up to an old thread

The module on the page shows how to add a new sort option to items list. Now I would like to make this new option the default sort order.

What we have, before adding new sort option is on the admin page admin.php?target=general_settings is what I attach below.

Now the drop down menu seems to come from the class View/FormField/Select/DefaultProductSortOrder.php

So I created a class that looks like
<?php namespace XLite\Module\XCExample\SortingByDate\View\FormField\Select; abstract class DefaultProductSortOrder extends \XLite\View\FormField\Select\Def aultProductSortOrder implements \XLite\Base\IDecorator { protected function getDefaultOptions() { return array( 'dateAsc' => static::t('Date asc') 'priceAsc' => static::t('Price asc'), 'priceDesc' => static::t('Price desc'), 'nameAsc' => static::t('Name asc'), 'nameDesc' => static::t('Name desc'), ); } }

However, this doesn't even compile (that is, after cache redeployment, there is no corresponding class under /var/run)

So, would anyone know how to make arrival date as default order?

X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -8. The time now is 06:51 AM.


X-Cart forums © 2001-2020