First, you need to remember what photosynthesis is. Photosynthesis represents the process where the water, carbon and sunlight are used to produce sugar and diverse organic compounds, such as proteins and lipid. Hence, in photosynthesis process, the sunlight energy is converted into chemical energy. The chemical equation that represents the photosynthesis process is the following, such that:
12H2O + 6CO2 + light -> 6H2O + 6O2 + C6H12O6
Most of the plants are autotrophs, obtaining their energy and nutrients by means of photosynthesis process. There exists parasitic plants that developed different mechanisms to gain their nutrients and energy. If majority of plants uses leaves in photosynthesis process, carnivorous plants, use their leaves to trap the pray.
A plant can be classified as carnivorous if it is able not only to capture the pray, but to digest it, in order to obtain the needed nutrients. To digest the pray, these plants produce enzymes such as nitrogen and phosphorous.
There exists one problem, the carnivorous plants do not obtain the needed carbon from digested pray, hence the photosynthesis process cannot be avoided, but it is altered by the changed shape of carnivorous plants leaves. Since the carnivorous plants have evolved in environments depleted by nutrients and sunlight, their capacity to obtain the nutrients by photosynthesis was diminished, therefore, the alternative mechanisms to obtain the food were developed. Sill, the energy to activate these mechanisms is required, hence, photosynthesis is realized, at a smaller scale, but there exists.