Antarr Posted August 11, 2016 Share Posted August 11, 2016 What are the possibilities (modules, custom work) to add custom features in the product (more than 255 characters), and compare them? I have a composition of the products (nutritional supplements), counterindications and the indications for their use. And I want ability for users the opportunity to compare products by composition and indications/counterindications. Right now I can't add composition as a feature just because the usual product contains dozens of words of text in the composition. Much more than 255 chars. Exactly the same state with the indications and contraindications. Yes, I can buy several Custom Tab modules etc but is there a chance to see them (additional features like product composition) in a standard Prestashop product comparison? Link to comment Share on other sites More sharing options...
rocky Posted August 12, 2016 Share Posted August 12, 2016 Have you trying going to phpMyAdmin and increasing the maximum length of the value field in ps_feature_value_lang? By default, it is VARCHAR(255). Then you can increase the value to the same amount on line 50 of classes/FeatureValue.php: 'value' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 255), Link to comment Share on other sites More sharing options...
Antarr Posted August 12, 2016 Author Share Posted August 12, 2016 (edited) Too simple. Is it real way? It happens that for huge problem I could only make two mouse clicks? How about support for HTML markup? Will it works inside feature field? Or everything will be in one line? Edited August 12, 2016 by Antarr (see edit history) Link to comment Share on other sites More sharing options...
Antarr Posted August 12, 2016 Author Share Posted August 12, 2016 (edited) Ouch. It works! Thank you! Edited August 12, 2016 by Antarr (see edit history) Link to comment Share on other sites More sharing options...
Antarr Posted August 12, 2016 Author Share Posted August 12, 2016 What should I do during upgrade to 1.7, 1.8 etc? Link to comment Share on other sites More sharing options...
rocky Posted August 13, 2016 Share Posted August 13, 2016 Hopefully, PrestaShop won't change the ps_feature_value table in future database upgrades and it will be left the way it is. The classes/FeatureValue.php file will be overwritten, however, so you'll need to change it again after upgrading, unless you create override/classes/FeatureValue.php with the following: <?php class FeatureValue extends FeatureValueCore { public function __construct() { FeatureValue::$definition['fields']['value']['size'] = 1024; parent::__construct(); } } Remember to delete cache/class_index.php so PrestaShop can find the override. PrestaShop will not change your overrides when upgrading. Link to comment Share on other sites More sharing options...
Antarr Posted August 13, 2016 Author Share Posted August 13, 2016 Thank you! 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