Sort Products In Cart By Vendor

If we have multiple products in cart can we sort them by Vendor so that the products from same vendor come together ?

app/controllers/frontend/checkout.php

add

$cart_products = fn_sort_array_by_key($cart_products, 'company_id');

after this line

$cart_products = array_reverse($cart_products, true);

(!) Not tested

Thanks it works

You are welcome!

Awesome! Is there a way to do this with my_changes?

Awesome! Is there a way to do this with my_changes?

Yes, you can use the checkout.post.php controller to get cart_products array, change and assign it to the template.