<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>Last "Not available"</name>
  <code>not_available_last</code>
  <version>1.1</version>
  <author>opencart2x.ru</author>
  <link>https://opencart2x.ru</link>
<file path="catalog/model/catalog/product.php">
        <operation>
        <search><![CDATA[$sql .= " ORDER BY p.sort_order";]]></search>
        <add position="replace"><![CDATA[$sql .= " ORDER BY p.quantity DESC, p.sort_order";]]></add>
        </operation>
  </file>
  <file path="catalog/controller/product/category.php">
    <operation>
        <search><![CDATA[$sort = 'p.sort_order';]]></search>
        <add position="replace"><![CDATA[$sort = 'p.quantity';]]></add>
        </operation>
      <operation>
        <search><![CDATA[$order = 'ASC';]]></search>
        <add position="replace"><![CDATA[$order = 'DESC';]]></add>
        </operation>
  </file>
</modification>