Skip to main content
deleted 46 characters in body
Source Link

Try this solution:

$collection = $subject->getCollection();
  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock desc']);

Try this solution:

$collection = $subject->getCollection();
  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock desc']);

Try this solution:

  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock desc']);
added 9 characters in body
Source Link

Try this solution:

$collection = $subject->getCollection();
  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock desc']);

Try this:

$collection = $subject->getCollection();
  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock desc']);

Try this solution:

$collection = $subject->getCollection();
  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock desc']);
added 1 character in body
Source Link

Try this:

$collection = $subject->getCollection();
  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock ASC']desc']);

Try this:

$collection = $subject->getCollection();
  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock ASC']);

Try this:

$collection = $subject->getCollection();
  $collection->getSelect()->joinLeft(
         ['_inventory_table' => 'cataloginventory_stock_item'], 
         "_inventory_table.product_id = e.entity_id", ['is_in_stock']
  );
  $collection->getSelect()->order(['is_in_stock desc']);
Source Link
Loading