Hello,
There is no built-in option to keep the date sorting while sending out-of-stock products to the end, the "Display out of stock products" setting is only a yes/no toggle. It can be done with a small HikaShop plugin, though.
First, set your listing or menu "Sort by" to the creation date the way you want it. Then create a HikaShop plugin (in the "hikashop" group) with this method, which adds an out-of-stock criterion in front of your existing sort:
public function onBeforeProductListingLoad(&$filters, &$order, &$obj, &$select, &$select2, &$a, &$b, &$on)
{
// Push products with a quantity of 0 to the end, keeping your date sort within each group
$stock = '(' . $b . '.product_quantity = 0)';
if (stripos($order, 'ORDER BY') !== false) {
$order = preg_replace('#ORDER BY\s+#i', 'ORDER BY ' . $stock . ', ', $order, 1);
} else {
$order = ' ORDER BY ' . $stock;
}
}
The result is "in stock first, then your creation-date order" within each group. Two notes: only products whose quantity is exactly 0 are moved, so products that do not manage stock stay where the date sort puts them; and a product that is out of stock only through its variants (while its own quantity is not 0) will not be moved, since this looks at the product's own quantity.
If you are not comfortable creating a plugin, your developer can set this up quickly.