You do not need to place "FIle opened" message in else branch. Actually you do not need conditional branching at all. Consider this:
1 2 3 4 5 6 7 8 9 10 11 12
//Default-construct our file stream
//so it is no associate with any file yet.
std::ifstream readSalesFile;
while(not readSalesFile.is_open() ) { //Loop until we properly open file
std::cout << "Enter path to your sales file:\n";
std::getline(std::cin, salesFile); //get file name
readSalesFile.open(salesFile); //Try to open it
}
//Following line will be executed only after loop finishes,
//i.e. when file was properly open
std::cout << "File was opened!\n";