Page 1 of 1

[SOLVED] Admin->products->special default customer sort

Posted: Wed Mar 19, 2025 11:42 pm
by Pat073
Hey all,
Version 3.0.4.0 Under admin-> customer-> groups I have
Customer group name sort order
A 3
B (default) 1
C 2

When I go to products->edit->specials tabs and click add to add a product special price, the drop down customer group menu is sorted by name ascending and not sort order ascending, meaning customer group A is the default" drop down menu" choice not default or sort order 1 customer group.
Can not find if it's the settings or something else causing this.

Re: Admin->products->special default customer sort

Posted: Thu Mar 20, 2025 12:12 am
by ADD Creative
Name is the default sort in admin. You would need to modify the code to change it.
https://github.com/opencart/opencart/bl ... up.php#L51

Re: Admin->products->special default customer sort

Posted: Thu Mar 20, 2025 1:35 am
by Pat073
Thanks ADD Creative.

Created a file in modification manager with code below, refreshed cache and voila.

Code: Select all

<modification>
    <name>Admin customer sort order</name>
    <version>1</version>
    <code>Admin customer sort order</code>
    <author>Pat</author>
	<file path="admin/model/customer/customer_group.php">
        <operation>
            <search><![CDATA[$sql .= " ORDER BY cgd.name";]]></search>
            <add position="replace"><![CDATA[$sql .= " ORDER BY cg.sort_order";]]>
            </add>
        </operation>	
  </file>
</modification>