mubeen.xjr Posted January 11, 2015 Share Posted January 11, 2015 Hi All, Got a bit of a problem. So imagine I have a product like a car engine oil which is suited for 10,000 cars. I have a filter search which searches via make model and engine to find the right oil for the car. Now, rather than having an oil product which lists all 10,000 cars in the description, which makes it completely unfeasible, is there a way I can have this car compatibility list still searchable but hiding the information somehow? Looking forward to your response Link to comment Share on other sites More sharing options...
vekia Posted January 11, 2015 Share Posted January 11, 2015 if i were you i will extend product object (new field for products guide) (instead of input box use <textarea>) then you will be able to define "hidden" car list. then it will be necessary to extend search controller to use also new field with hidden car lists Link to comment Share on other sites More sharing options...
mubeen.xjr Posted January 11, 2015 Author Share Posted January 11, 2015 This is awesome. Will give it a shot Link to comment Share on other sites More sharing options...
mubeen.xjr Posted January 11, 2015 Author Share Posted January 11, 2015 Ok so I am following the instructions provided, and am on the final step where I have to edit the informations.tpl file. I currently have the latest prestashop so the following code is not there for step 3?: <tr> <td class="col-left"> {include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"} <label>{l s='Name:'}</label> </td> <td style="padding-bottom:5px;" class="translatable"> {foreach from=$languages item=language} <div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;"> <input class="{$class_input_ajax}{if !$product->id}copy2friendlyUrl{/if} updateCurrentText" size="43" type="text" {if !$product->id}disabled="disabled"{/if} id="name_{$language.id_lang}" name="name_{$language.id_lang}" value="{$product->name[$language.id_lang]|htmlentitiesUTF8|default:''}"/><sup> *</sup> <span class="hint" name="help_box">{l s='Invalid characters:'} <>;=#{}<span class="hint-pointer"> </span> </span> </div> {/foreach} </td> </tr> Any ideas Link to comment Share on other sites More sharing options...
vekia Posted January 11, 2015 Share Posted January 11, 2015 indeed. guide is based on prestashop 1.5 but whole logic should work with 1.6. there is a code like: <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="condition" type="default"}</span></div> <label class="control-label col-lg-2" for="condition"> {l s='Condition'} </label> <div class="col-lg-3"> <select name="condition" id="condition"> <option value="new" {if $product->condition == 'new'}selected="selected"{/if} >{l s='New'}</option> <option value="used" {if $product->condition == 'used'}selected="selected"{/if} >{l s='Used'}</option> <option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option> </select> </div> </div> right below paste this: <div class="form-group"> <div class="col-lg-1"><span class="pull-right"></span></div> <label class="control-label col-lg-2" for="description_{$id_lang}"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='Hidden field with cars'}"> {l s='Cars'} </span> </label> <div class="col-lg-9"> <textarea name="YourFieldName">{$product->YourFieldName}</textarea> </div> </div> replace YourFieldName with name of the variable that you use effect: Link to comment Share on other sites More sharing options...
mubeen.xjr Posted January 12, 2015 Author Share Posted January 12, 2015 Hi, Thanks for your help. It now displayable, however, whenever i add information into it and save, i get the following error: Fatal error: Call to undefined method Validate::IsInternal_compatbility() in /customers/5/d/a/part-id.co.uk/httpd.www/controllers/admin/AdminProductsController.php on line 2080 Any ideas Link to comment Share on other sites More sharing options...
vekia Posted January 12, 2015 Share Posted January 12, 2015 hello what is IsInternal_compatbility() i checked original file, there is no "IsInternal_compatbility()" so it's not default code you added it ? Link to comment Share on other sites More sharing options...
mubeen.xjr Posted January 12, 2015 Author Share Posted January 12, 2015 Yes i added the following line into Product.php (my new column in sql is called 'internal_compatibility' with varchar set to max) internal_compatibility' => array('type' => self::TYPE_STRING, 'validate' => 'IsInternal_compatbility', 'size' => 2147483647) Link to comment Share on other sites More sharing options...
vekia Posted January 12, 2015 Share Posted January 12, 2015 and you created IsInternal_compatbility validate functon to validate this kind of data? if you want to store simple varchar, use "isAnything" instead of "isInternal_compatbility" Link to comment Share on other sites More sharing options...
mubeen.xjr Posted January 12, 2015 Author Share Posted January 12, 2015 and you created IsInternal_compatbility validate functon to validate this kind of data? if you want to store simple varchar, use "isAnything" instead of "isInternal_compatbility" Awesome! this fixed it 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