Passive form of a sentence that has "promise to [verb]"
Solution 1:
The manufacturer promises to repair or replace the product if necessary within warranty period.
Here, the manufacturer is the subject of promises, repair and replace.
If you only change one verb to the passive like this:
The product was promised by the manufacturer to repair or replace if necessary within warranty period.
You have introduced a problem in your sentence. The subject of the sentence is now the product, and repair and replace now also have the product as their subject. But the product will not repair or replace itself!
You have to change all the verbs to correspond with the subject, as you did in your second sentence:
The product was promised to be repaired or replaced if necessary within warranty period by the manufacturer.
You could change part of the sentence to passive like this
The manufacturer promised (that) the product would be repaired or replaced if necessary within warranty period by the manufacturer.
This sounds more natural than the fully passive version of sentence 2.