I've try to resolve this issue many hours but end up with no luck.
Here is the senario:
I have a store locator and have 2 types of dealers. Master and General. I need to list Master dealer first and General Dealers 2nd. Best solution is to use UNION in collection
$cloneSelect = clone( $collection1->getSelect() ); $collection1->getSelect()->reset()->union( array( "( ". $cloneSelect ." )", "( ". $collection2->getSelect() ." )", ) );
When I view $collection->getSelect()->__toString() this generate ( $collection1 ) UNION ( $collectio2 )
but when I apply $collection1->getSize() or any method it generate following error.
No table has been specified for the FROM clause
I know it generate this error becouse $collection need to have from clause, If that's the case dose anyone have IDEA how to do union and get collection