Convert something that runs off two D cell batteries to instead run off a car battery
Two D batteries provide 3V. You can use a 3V regulator (LM317 wired properly) to decrease the car battery voltage to 3V.

However, since this is a gas heater, I'd recommend paying the $10 and getting the replacement... for peace of mind and preventing a fire (explosion) hazard.

To explain about the possibility of explosion hazard... If it is possible to supply the 3V using long wires (i.e. the battery and voltage converter is somewhere else, at least a few meters away) this should be safe. Considering also that if the heater is waterproof, it may also be outdoors, not in an enclosed space, which reduces the risk. If this was a manually operated device, i.e. you turn a knob for the spark, and gas line shuts off if flame goes out, there would not be any worry. However, the supply is 12V, so 9V is dropped across the regulator. To create sparks a substantial current is drawn by the boost converter (which creates a high voltage), hence the D cells (instead of AA cells). Being automatic, if there is some intermittent fault in the gas line, the boost converter will operate for a longer time and draw high current. At 9V drop, this will heat up the voltage regulator, maybe a lot. If located near the gas line, could lead to an explosion. Risk can be minimized by using a 5V or 6V supply for the LM317, and a large heatsink for it. In any case, it is best to place it far away from the gas lines. Other than that, it should all be fine. Use thicker wires and make sure they are connected properly (crimped).

One could potentially use a step down buck converter to decrease 12V to 5V, and then regulate it down to 3V (or 3.2V to account for voltage drop on long wires). This is probably safest, and most energy efficient (considering it may be running from solar), but may just be too much work. With a step down buck converter to 3V, the regulator may not even be necessary, but that may be a bit risky, without knowing what's in the boost circuit inside the heater. If the gas does actually turn off, if the flame igniter fails, then it may be safe, otherwise not.