Jump to content

Add new fields to import.


Recommended Posts

Hello everyone!
Use PS and

I have to add the features to products (books) and i have to import several thousands of books (which have characteristics as Author, Publisher, Place edition, Year of publication).  Now importing as manufactured from there is in the list of possible fields these specific features but there is only a generic field "characteristics"

there is a possibility, by acting on the code, add those four specific fields that can be viewed at the time of importation? Who could do it?

Link to comment
Share on other sites

  • 2 weeks later...



If you could provide some more details I can try to help;

What format are the books you're importing in? (CSV? Can you give an example how the data is structured?)

What method do you use for importing? (Module? Custom solution?)

Hi jgullstr!

The format is CSV


This is a example:


The colored columns are the characteristics that i have to enter during the import. For me, it is important that the features remain in column and not inside a record horizontally. With version is not admitted this import but only that within a record (Name: Value, Detail: Value, ... )


My method is only "Import CSV" of PS As far as i know there is not a form appropriate to my needs, but only the default method of PS. I must to use only the PS

Link to comment
Share on other sites



I'd approach this problem by writing a module, that imports the features by product reference after the CSV import has finished. Depending on the recurrence of imports, the complexity of this method may vary. If you're a developer, I suggest you start by looking at the following snippet (also found here):

$feature = array(
  'key' => 'Size',
  'value' => 'humongous',

$id_feature = Feature::addFeatureImport($feature['key']);
$id_feature_value = FeatureValue::addFeatureValueImport($id_feature, $feature['value']);
$feature_value = new FeatureValue($id_feature_value);
$feature_value->custom = 0;
Product::addFeatureProductImport((int) $product->id, $id_feature, $id_feature_value);

There might be better ways to do this, but this is the most obvious that comes to mind for me.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...