That's not really an ML problem. It's a search problem. You'd need an index (or at least db) of all e-commerce products. Then you can potentially use ML to find competitors, but I feel like for this you don't need ML
a simple if statement for the two products being of the same type will suffice.