Jump to content

Checkbox Doesn't Uncheck


Recommended Posts



I created a new field in my database in the table ps_product. It's just a new checkbox who takes for value 0 or 1 (checked or unchecked).


To add this in my back-office, I'm going to modify Product's class in Product.php, add my field in the definition.

Finally, to display this in "Price" tab, I put this code :

<div class="form-group">
	<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="is_solde" type="default"}</span></div>
	<label class="control-label col-lg-2" for="is_solde"> </label>
	<div class="col-lg-9">
		<div class="checkbox">
			<label class="control-label" for="is_solde" >
				<input type="checkbox" name="is_solde" id="is_solde" {if $product->is_solde}checked="checked"{/if} value="1" />
				{l s='Display the "sold" icon on the product page, and in the text found within the product listing.'}

After testing, if I check my field, put my value at 1 (so good).

But, when I unchecked, the value doesn't put back at 0. However, when i save the product's page, I have the message "Update success !". And my checkbox is checked :D


I don't know where is the problem :wacko:


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...