How to show posts from category A on category B page?

I was able to solve the issue by adding the following before $wp_query->set(' :

$wp_query->set( 'product_cat', 'sling-bags' );

error code: 523