Sorting by Products by SKU
Hello I managed to make it work on my localhost.
1.) Option for SKU sort 2.) Auto sort all by sku alpha using idecorator here's the code public function __construct(array $params = array()) { parent::__construct($params); $this->sortByModes = array( 'p.sku' => 'Part Number', ) + $this->sortByModes; } /** * getSortByModeDefault * * @return string */ protected function getSortByModeDefault() { return static::SORT_BY_MODE_SKU; } It's working in my localhost but it doesn't in my live site.... maybe because my localhost has older modules than my live site? I have Simple CMS 5.2.12 in localhost and Simple CMS 5.2.14 in live site Could this be causing it not to work, I even changed the core file to SORT_BY_MODE_SKU to testbut same outcome not working :( |
Re: Sorting by Products by SKU
Every class extended from \XLite\View\ItemsList\AItemsList class has the getSortByModeDefault() method, but the SORT_BY_MODE_SKU constant is declared in \XLite\View\ItemsList\Model\Product class, so if you want to use this constant, your class must has the Product class in its inheritance tree.
What class do you use this constant in? |
Re: Sorting by Products by SKU
Im sorry it's working now my error was
in my live site my code is + + $this->sortByModes; it should be + $this->sortByModes; Thanks anyways for the tips sir! :D cheers~! |
Re: Sorting by Products by SKU
Im sorry my bad can I revive this post? The only one that's working is the first functionality to add new sort option.. The automatic sort is not working...
I used the SORT_BY_MODE_SKU in \XLite\View\ItemsList\Product\Customer\ACustomer Class. In the core file > function getSortByFields I noticed the constant is there so i assumed it can be used as a default in getSortByModeDefault() How can I inherit it in my class? |
Re: Sorting by Products by SKU
Quote:
Have you figured out how to make "automatic sort" (recommended default sort) working ? |
Re: Sorting by Products by SKU
1 Attachment(s)
Please find a sample module "SortingBySKU" attached.
|
Re: Sorting by Products by SKU
Quote:
|
All times are GMT -8. The time now is 08:23 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.