Quote Originally Posted by igi2011 View Post
OK here's how I did it - my example shows the field I wanted to add (products_family), obviously yours will be different :)

There are three files to edit:
YOUR-ADMIN-FOLDER/includes/functions/extra_functions/easypopulate_4_functions.php
YOUR-ADMIN-FOLDER/easypopulate_4.php
and YOUR-ADMIN-FOLDER/easypopulate_4_import.php

You're using the existing 'upc' field each time to create a new product field.

Firstly open YOUR-ADMIN-FOLDER/includes/functions/extra_functions/easypopulate_4_functions.php. Search for

if ($ep_supported_mods['upc'] == true) { // UPC Mod
$filelayout[] = 'v_products_upc';
}

Now make a copy of this code directly underneath and change this to

if ($ep_supported_mods['family'] == true) { // Products Family Mod
$filelayout[] = 'v_products_family';
}

so you now have

if ($ep_supported_mods['upc'] == true) { // UPC Mod
$filelayout[] = 'v_products_upc';
}
if ($ep_supported_mods['family'] == true) { // Products Family Mod
$filelayout[] = 'v_products_family';
}

Now find the following a few lines further down:

if ($ep_supported_mods['upc'] == true) { // UPC Code mod
$filelayout_sql .= 'p.products_upc as v_products_upc,';
}

Copy this chunk of code and change as before, so you now have:

if ($ep_supported_mods['upc'] == true) { // UPC Code mod
$filelayout_sql .= 'p.products_upc as v_products_upc,';
}
if ($ep_supported_mods['family'] == true) { // Products Family mod
$filelayout_sql .= 'p.products_family as v_products_family,';
}

Now open YOUR-ADMIN-FOLDER/easypopulate_4.php and search for 'upc' again - around line 90

$ep_supported_mods['upc'] = ep_4_check_table_column(TABLE_PRODUCTS,'products_upc'); // upc = UPC Code, added by Chadd

Make a copy so you now have

$ep_supported_mods['upc'] = ep_4_check_table_column(TABLE_PRODUCTS,'products_upc'); // upc = UPC Code, added by Chadd
$ep_supported_mods['family'] = ep_4_check_table_column(TABLE_PRODUCTS,'products_family'); // Products Family

Finally open YOUR-ADMIN-FOLDER/easypopulate_4_import.php and search for 'upc' again, there are four edits to make here, here's what mine looks like with the 'family' fields added (the line numbers may be slightly out)

Line 26:
if ($ep_supported_mods['upc'] == true) { // UPC Code mod - chadd
$default_these[] = 'v_products_upc';
}
if ($ep_supported_mods['family'] == true) { // UPC Code mod - chadd
$default_these[] = 'v_products_family';
}


Line 150:
if ($ep_supported_mods['upc'] == true) { // UPC Code mod- chadd
$sql .= 'p.products_upc as v_products_upc,';
}
if ($ep_supported_mods['family'] == true) { // products_family
$sql .= 'p.products_family as v_products_family,';
}

Line 594:
if ($ep_supported_mods['upc'] == true) { // UPC Code mod
$query .= "products_upc = '".addslashes($v_products_upc)."',";
}
if ($ep_supported_mods['family'] == true) { // products_family
$query .= "products_family = '".addslashes($v_products_family)."',";
}

Line 660:
if ($ep_supported_mods['upc'] == true) { // UPC Code mod
$query .= "products_upc = '".addslashes($v_products_upc)."',";
}
if ($ep_supported_mods['family'] == true) { // family
$query .= "products_family = '".addslashes($v_products_family)."',";
}


Hope this helps - this should work for the fields in the products table, but it might need a bit of tweaking for the field you have in the description table (not sure myself as I haven't tried it)
Thanks,

this could make what I am trying to do a little easier. I have the same issue as several others and thought that ep4 could help fix them.

I have noticed that there are several posts on how to change the product type from 1 to 2 and I thought that by adding the fields

v_product_type
v_product_music_extras
v_record_artists
v_record_artists_info
v_record_company
v_record_company_info
v_music_genre


to ep4 would help in the creation of the new products before the old ones are deleted or just to add new products to Product - Music.

Don't know if I am on the right track or not, so I would appreciate your thoughts on this.