Jump to content

import - duplicate properties prestashop_1.5.6 -1


Recommended Posts

adding imports csv goods duplicated property
file - www\classes - Feature.php
 
that it is necessary to change the code?
 
 
public static function addFeatureImport($name, $position = false)
    {
        $rq = Db::getInstance()->getRow('
            SELECT `id_feature`
            FROM '._DB_PREFIX_.'feature_lang
            WHERE `name` = \''.pSQL($name).'\'
            GROUP BY `id_feature`
        ');
        if (empty($rq))
        {
            // Feature doesn't exist, create it
            $feature = new Feature();
            $languages = Language::getLanguages();
            foreach ($languages as $language)
                $feature->name[$language['id_lang']] = strval($name);
            if ($position)
                $feature->position = (int)$position;
            else
                $feature->position = Feature::getHigherPosition() + 1;
            $feature->add();
            return $feature->id;
        }
        else
        {
            if ($position && $feature = new Feature((int)$rq['id_feature']))
            {
                $feature->position = (int)$position;
                $feature->update();
            }

            return (int)$rq['id_feature'];
        }
    }

Image-333.BMP

Link to comment
Share on other sites

×
×
  • Create New...