Material Substitution


I have read some of the other messages on the topic of material substitution and still have a few questions.

This is my scenario;

If Product B is not in stock I can substitute with Product A (higher grade). I will charge the same price to the customer (price of Product B will be charged) and all my customer facing documents are to show Product B.

How should I set up the configuration for this?

What are the item category assignments that must be done for this?

Thank you.