Jump to content

Import products without name as required?


Recommended Posts

Hi guys.

 

Is it possible to change files of prestashop like "AdminImport.php" or others, so that i can import CSV files without name as a required field?

 

I want to be able to update products with ID and active= 1 or 0 nothing else.

 

If you know a module that can do this, please share :-)

 

Thanks in advance for your help.

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...

I've found a solution:

Look for the following lines in AdminImport.php (in map /admin/tabs):

 

case $this->entities[$this->l('Products')]:

 

self::$validators['image'] = array('AdminImport', 'split');

 

$this->available_fields = array(

 

and replace it with:

 

case $this->entities[$this->l('Products')]:

 

self::$required_fields = array('id');

self::$validators['image'] = array('AdminImport', 'split');

 

$this->available_fields = array(

 

You see I've added 1 line: self::$required_fields = array('id');

Now you can import goods without the required name to import, only ID is required.

I tested it and it works perfectly.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...