Prestashop 1.6 extend max size of product feature value

╄→гoц情女王★ 提交于 2019-12-08 09:12:24

问题


This is my first question on stackoverflow :) I need to import a csv file with product features values longer than 128 characters. How can I extend the maximum size of product features values in prestashop 1.6?


回答1:


The feature value field should be 255 characters long, unless you are using some special characters or different encoding.

Anyway, change the column type in ps_feature_value_lang table to your preference,

Then make an override for FeatureValue.php class. Make a file at override/classes/FeatureValue.php and inside this file:

class FeatureValue extends FeatureValueCore
{
    /**
 * @see ObjectModel::$definition
 */
public static $definition = array(
    'table' => 'feature_value',
    'primary' => 'id_feature_value',
    'multilang' => true,
    'fields' => array(
        'id_feature' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
        'custom' =>     array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),

        // Lang fields
        'value' =>      array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 255),
    ),
);
}

Modify 'size' => 255 to match the db column.



来源:https://stackoverflow.com/questions/28902159/prestashop-1-6-extend-max-size-of-product-feature-value

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!