Jump to content

Nuevo Campo Booleano en la fiche del producto admin


Recommended Posts

Buenos días,

estoy intentando poner un nuevo campo Booleano en la pagina de producto pero no consigo que se actualice en la BBDD cuando guardo el producto, dejo todo el codigo.

 

Product.php

Product::$definition['isBool']['test_product'] = array('type' => Product::TYPE_BOOL, 'lang' => false, 'validate' => 'isBool');

 

Informations.tpl

	<div class="form-group">
		<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="test_product" type="radio" onclick=""}</span></div>
		<label class="control-label col-lg-2">
			{l s='Enabled'}
		</label>
		<div class="col-lg-9">
			<span class="switch prestashop-switch fixed-width-lg">
				<input onclick="toggleDraftWarning(false);showOptions(true);showRedirectProductOptions(false);" type="radio" name="test_product" id="test_product_on" value="1" {if $product->test_product}checked="checked"{/if} />
				<label for="test_product_on" class="radioCheck">
					{l s='Yes'}
				</label>
				<input onclick="toggleDraftWarning(false);showOptions(true);showRedirectProductOptions(false);" type="radio" name="test_product" id="test_product_off" value="0" {if !$product->test_product}checked="checked"{/if} />
				<label for="test_product_off" class="radioCheck">
					{l s='No'}
				</label>
				<a class="slide-button btn"></a>
			</span>
		</div>
	</div>

 

En la BBDD de products he creado un nuevo campo con los siguientes datos.

name: test_product
type: tinyint
length: 1
not null: Check
Default value: 0

Captura de pantalla 2018-06-06 a las 16.45.15.png

  • Sad 1
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...