I'm not a dev so please be patience
I have source this code on the marketplace but it's not longer maintened... Testing this ocmod on my testing installation in Opencart 3.0.3.6 and 3.0.3.8
This xml file will automatically add a product sort order number in the Frontend if the product have 0 and it will mirror the product ID into the Sort-order field but it won't actually assing it into the DB Table, and it will be good to have it added to the db as well too
Thanks for your collaboration,
https://github.com/opencart/opencart/bl ... roduct.php admin/controller/catalog/product.php
https://github.com/opencart/opencart/bl ... roduct.php admin/model/catalog/product.php
Code: Select all
<file path="admin/controller/catalog/product.php">
<operation>
<search><![CDATA[ $data['sort_order'] = $this->request->post['sort_order']; ]]></search>
<add position="after"><![CDATA[ } elseif ((!empty($product_info)) && ($product_info['sort_order'] == 0)) {
$data['sort_order'] = ( 0 + $this->request->get['product_id'] );]]></add>
</operation>
<!-- Automatic Product Sort Number -->
<operation>
<search><![CDATA[ $data['sort_order'] = 1; ]]></search>
<add position=" replace"><![CDATA[ $data['sort_order'] = 0;]]></add>
</operation>
</file>