What if I want to apply linear regression model only when a certain condition of a input column is met?

So, I used training data to create a linear regression model. Now, on test data I do not want to directly apply model.predict instead what I want is that I be given output=0 whenever a certain feature takes value 0 and otherwise, I be given value that the regression model would give. I executed the following code but it is giving me the model value always, it is not giving 0 as output even in cases where the value of the feature specified is 0.

input_cols_test= [‘clicks’, ‘impressions’, ‘cost’, ‘conversions’, ‘adgroup 1’, ‘adgroup 2’, ‘adgroup 3’, ‘adgroup 4’]
inputs_test= test_csv[[‘clicks’, ‘impressions’, ‘cost’, ‘conversions’, ‘adgroup 1’, ‘adgroup 2’, ‘adgroup 3’, ‘adgroup 4’]]
targets=[]
for n in test_csv[‘conversions’]:
if n == 0:
targets = 0
else:
targets = (model.predict(inputs_test))

the model that I created was this

input_cols = [‘clicks’, ‘impressions’, ‘cost’, ‘conversions’, ‘adgroup 1’, ‘adgroup 2’, ‘adgroup 3’, ‘adgroup 4’]
inputs, targets = train_csv[input_cols], train_csv[‘revenue’]

Create and train the model

model = LinearRegression().fit(inputs, targets)

The problem, as I explained is that even when in the test data, the conversions column is taking value 0, target is not being assigned 0 but rather model.predict is being applied and I am getting the prediction made by the model.predict