Sort by Product Code v3.0.4

So I've found some solutions to sorting by product code on customer side for version 2.x, but for the life of me, I can't find any way to add it to 3.0.4.



Does anyone know how to add “sort by product code” to version 3.0.4?



Thanks,



Brandon

Hello Brandon,



Thank you for your message.



Some code modifications are required to implement this feature. We would be happy to assist you in this matter within our technical support service. Please contact us via Customer Help Desk if you have support credits or an active support period.



Thank you.





Pavel Zyukin

CS-Cart Support team

This isnt the WHOLE answer but its probably a good place to get started.





CS-Cart Documentation — CS-Cart 4.15.x documentation



GL



~B.

Brandon, I posted a thread on this some time ago. I'm pretty sure on my test install of 3.x it is the same procedure but it may not be exactly what you want. What I posted was how to make the product sorting by code a selection in the sorting options in settings. The only drawback in your situation is that it will make both the front and back end sort by code. However, even if you do not select it as default, it will still show as an option in the sorting list.

Man, do you know where that thread is? I've searched and searched and can't find any threads for this for version 3.x



I think the limitations you talk about would be acceptable for this job, so I don't see them as a problem.



If you can please point me in the right direction, I'd really appreciate it.



Thanks,



Brandon

Here are a couple screen shots from my test 3.0.3. I believe the only thing that was different was the language.



[attachment=6179:Settings __ Appearance - Administration panel_1354333886099.png]



[attachment=6180:Accuracy Products __ Rests & Support -_1354334162486.png]

Accuracy Products __ Rests & Support -_1354334162486.png

Settings __ Appearance - Administration panel_1354333886099.png

Sweet, that looks awesome. Do you remember what you did to make that work?



Thanks,



Brandon

Well I found the thread(s). One was from 1.x and the other 2.x. Product Sorting v2.x - Hints & Modifications - CS-Cart Community Forums



That should give you some ideas. If you have any trouble, let me know.

I went through those threads, but none of that code exists anymore and so I wasn't able to figure it out.



I'd be more than happy to slip you a few bucks if you could help. Shoot me an email if you want. My email is brandon at jandkonline dot com



Thanks,



Brandon

No need for bucks…you help the community a great deal.



The code looks basically the same to me (3.0.3). Grrr I hate opening files of this size in the code editor. It takes forever to load.



/core/fn.catalog.php

function fn_get_products_sorting($simple_mode = true)
{
$sorting = array(
'timestamp' => array('description' => fn_get_lang_var('date'), 'default_order' => 'desc'),
'position' => array('description' => fn_get_lang_var('default'), 'default_order' => 'asc'),
'code' => array('description' => fn_get_lang_var('code'), 'default_order' => 'asc'), // sort by code The Tool
'product' => array('description' => fn_get_lang_var('name'), 'default_order' => 'asc'),
'price' => array('description' => fn_get_lang_var('price'), 'default_order' => 'asc'),
'popularity' => array('description' => fn_get_lang_var('popularity'), 'default_order' => 'desc')
);

Sweet, thank you Tool. That definitely got me going in the right direction.



Brandon

Second here for thanks to The Tool :)