Jump to content

Hide custom code on product page after in back office attribute is checked


Recommended Posts

Hello!

 

I have some question. So our prestashop has a custom code in the product.tpl. This is a calculator. However we don't need this calculator on every product so we would like to achive a funciton. We created a checkbox in the admin theme for the products. We would like to solve that if the "Hide" Checkbox is checked the calculator won't display on that product where it was checked. On the test product We already created the code in the admin something like this.

<div class="form-group">
		<div class="col-lg-1">
			<span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="calc" type="default"}</span>
		</div>
		<label class="control-label col-lg-2" for="id_calc_group">
			{l s='Calculator:'}
		</label>
			<div class="checkbox">
					<label for="mincalc_no">
						<input type="checkbox" name="mincalc_no" id="mincalc_no" value="0" {if $product->mincalc_no}checked="checked"{/if} value="1" />
							{l s='Hide'}
					</label>
				</div>
	</div>

But when I checked the box and tried to save the product after the refresh it's unchecked again. The first problem lies here. The second problem is that I tried to make something similar to the "on sale" but I don't know how should I hide the calculator in the product.tpl. If I check the code for the on sale I see something like $sale_sticker then the function but it's only for the text not for the display where should I edit the code?
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...