| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Sorting by Products by SKU | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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
__________________
X-Cart Business 5.2.13 |
|||||||
#2
|
|||||||||
|
|||||||||
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?
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
#3
|
|||||||
|
|||||||
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! cheers~!
__________________
X-Cart Business 5.2.13 |
|||||||
#4
|
|||||||
|
|||||||
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?
__________________
X-Cart Business 5.2.13 |
|||||||
#5
|
|||||||
|
|||||||
Re: Sorting by Products by SKU
Quote:
Have you figured out how to make "automatic sort" (recommended default sort) working ?
__________________
/David Gao/ X-cart business 5.3.6 |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Sorting by Products by SKU
Please find a sample module "SortingBySKU" attached.
__________________
Sincerely yours, Sergey Fomin X-Cart team Chief support group engineer === Check this out. Totally revamped X-Cart hosting http://www.x-cart.com/hosting.html Follow us: https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart |
|||||||||
#7
|
|||||||
|
|||||||
Re: Sorting by Products by SKU
Quote:
__________________
/David Gao/ X-cart business 5.3.6 |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|