View Single Post
  #5  
Old 08-30-2022, 01:12 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: New Sort By Option

Hi, this thread is kind of old, but has anyone had any luck with this ?


Here is what I have noticed on the version 5.4.35 (I am using Dewy Green theme on top of the crispy white skin, but I have checked the situation disabling Crispy White skin)


In the class XLite/View/ItemsList/Product/Customer/ACustomer.php (which is precisely what is overwritten in the module quoted in the documentation)

Code:
/** * @param array $params Widget params OPTIONAL */ public function __construct(array $params = []) { parent::__construct($params); $this->sortByModes = [ static::SORT_BY_MODE_PRICE => 'Price-sort-option', static::SORT_BY_MODE_NAME => 'Name-sort-option', ]; } /** * Get products 'sort by' fields * * @return array */ protected function getSortByFields() { return [ 'price' => static::SORT_BY_MODE_PRICE, 'name' => static::SORT_BY_MODE_NAME, 'sku' => static::SORT_BY_MODE_SKU, 'amount' => static::SORT_BY_MODE_AMOUNT, ]; }



Now, I don't have any module that could possibly show "recommended" product activated (they are, however, installed, and have been activated in the past) like featured product, best seller, cloud search. However, on my catalogue, I get "Recommended" as the default sorting order.


I searched where on earth this string could come from, the only file that could possibly be relevant is View/FormField/Select/DefaultProductSortOrder.php which contains


Code:
protected function getDefaultOptions() { return array( 'default' => static::t('Recommended'), 'priceAsc' => static::t('Price asc'), 'priceDesc' => static::t('Price desc'), 'nameAsc' => static::t('Name asc'), 'nameDesc' => static::t('Name desc'), );


Now, there is no string, priceAsc etc., that appears in any other classes. Does anyone have any idea what is going on here ?
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote