Fastplayz Posted February 23, 2014 Share Posted February 23, 2014 (edited) I copyed on_sale field and created my own costum image options, DB in phpMyAdmin Added under ps_product table new column Name: icontests Type: TINYINT Length/Values: 1 Default: As defined 0 Attributes: UNSIGNED and same in ps_product_shop table Created new line (s) in mysite/classes/Product.php /** @var boolean icontests */ public $icontests = false; Created new line (s) in mysite/classes/Product.php 'icontests' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'), Created new line (s) in mysite/admin5161/themes/default/template/controllers/products/informations.tpl <tr> <td class="col-left"> <label> </label> </td> <td> <input type="checkbox" name="icontests" id="icontests" style="padding-top: 5px;" {if $product->icontests}checked="checked"{/if} value="1" /> <label for="icontests" class="t">{l s='Test check box!!!'}</label> </td> </tr> <tr> Created new line (s) in mysite/themes/leometr/product.tpl {if $product->icontests} <img src="https://cdn2.iconfinder.com/data/icons/metro-uinvert-dock/128/Steam.png" alt="test" /> {/if} Basically i copied field on_sale and added my own inpult name what is icontests Problem is that when i click on checkpox it save changes but if i want uncheck and save product changes it wont uncheck, so can anyone help me what i have done wrong? Edited February 23, 2014 by Fastplayz (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 23, 2014 Share Posted February 23, 2014 maybe create two radio boxes with NO and YES then you will save in DB false or true Link to comment Share on other sites More sharing options...
Fastplayz Posted February 23, 2014 Author Share Posted February 23, 2014 maybe create two radio boxes with NO and YES then you will save in DB false or true Where you mean? Link to comment Share on other sites More sharing options...
Fastplayz Posted February 23, 2014 Author Share Posted February 23, 2014 agin noone wont answer... Link to comment Share on other sites More sharing options...
vekia Posted February 23, 2014 Share Posted February 23, 2014 your reply: 12:52 PM and reply with "agin noone wont answer..." 01:59 PM it's not a chat. it's forum and you're not the only one here. if you're looking for instant help, hire some developer, or just accept fact. in addition, remember that it's sunday. Where you mean? where? in mysite/admin5161/themes/default/template/controllers/products/informations.tpl instead of <input type="checkbox" name="icontests" id="icontests" style="padding-top: 5px;" {if $product->icontests}checked="checked"{/if} value="1" /> <label for="icontests" class="t">{l s='Test check box!!!'}</label> use two <input type="radio" name="icontests"> first one with value="1", second with "0" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now