问题
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