alex177770 Posted August 27, 2015 Share Posted August 27, 2015 Hello, I tried to add a new field to my product creation and the result is that I can´t save the product and have the next issues: Este campo link_rewrite se requiere por lo menos en Español (Spanish). I make the next changes: 1. Add create new field in ps_product table. 2. Add create new field in ps_product_shop table. 3. Modify core files in classes/product.php /** @var enum Product condition (brand, official store, store, professional seller, private seller) */ public $seller_type; 'seller_type' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('brand', 'official store', 'store', 'professional seller', 'private seller' ), 'default' => 'brand'), 4. Modify product edit .tpl file located in this path: ADMIN_DIR/themes/default/template/controllers/products/informations.tpl <div class="form-group"> <label class="control-label col-lg-3" for="seller_type"> {include file="controllers/products/multishop/checkbox.tpl" field="seller_type" type="default"} {l s='Seller type'} </label> <div class="col-lg-3"> <select name="seller_type" id="seller_type"> <option value="brand" {if $product->seller_type == 'brand'}selected="selected"{/if} >{l s='Brand'}</option> <option value="official store" {if $product->seller_type == 'official store'}selected="selected"{/if} >{l s='Official store'}</option> <option value="store" {if $product->seller_type == 'store'}selected="selected"{/if}>{l s='Store'}</option> <option value="professional seller" {if $product->seller_type == 'professional seller'}selected="selected"{/if} >{l s='Professional seller'}</option> <option value="private seller" {if $product->seller_type == 'private seller'}selected="selected"{/if} >{l s='Private seller'}</option> </select> </div> </div> 5. Finally modify the THEME product.tpl (to show the result on my shop) {capture name=seller_type} {if $product->seller_type == 'brand'}{l s='Brand'} {elseif $product->seller_type == 'official store'}{l s='Official store'} {elseif $product->seller_type == 'store'}{l s='Store'} {elseif $product->seller_type == 'professional seller'}{l s='Professional seller'} {elseif $product->seller_type == 'private seller'}{l s='Private seller'} {/if} {/capture} <p id="product_condition"{if !$product->seller_type} style="display: none;"{/if}> <label>{l s='Seller type'}: </label> <span class="editable" itemprop="seller_type">{$smarty.capture.seller_type}</span> </p> Really need your help with this. Thank you, Alex. Link to comment Share on other sites More sharing options...
vekia Posted August 27, 2015 Share Posted August 27, 2015 you had the same issue before you modified the controllers and classes? Link to comment Share on other sites More sharing options...
alex177770 Posted August 27, 2015 Author Share Posted August 27, 2015 Hello Vekia, I really appreciate your quick response. you had the same issue before you modified the controllers and classes? No.. Before I do that I make the same process adding new fields to product "condition" and everithing worked fine. But I´m not sure if I add the ps_product table and ps_product_shop table correctly for seller_type field. Thank you, Alex. Link to comment Share on other sites More sharing options...
alex177770 Posted August 27, 2015 Author Share Posted August 27, 2015 The problem was SOLVED. The problem was from ps_product table and ps_product_shop table : Thank you very much Vekia. 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