Forum Moderators: open
But of course when I go to actually *import* data, my hackjob isn't working so well. So I was hoping someone here could help me with the semantics, as I seem to be turning my brain into mush trying to get it right.
So, the table in the database has two new fields that I created: "products_description2" and "products_description3". Like I said, I've managed to get absolutely everything to work great - I just can't get the Easy Populate hack to *import* the edited data for these two fields.
The current code (the original working code) for the products_description area looks like so:
$epLayout['products_description'] = array('products_name', 'products_description', 'products_url');
$epControl['smart_tags'] = array('products_name' => false, 'products_description' => true, 'products_url' => false, 'products_short_desc' => true);
if (isset($ep_supported_mods['psd']))
{
$epLayout['products_description'][] = 'products_short_desc';
}
$sql_array = array();
foreach ($ep_languages as $lang)
{
if ($product_is_new)
{
$sql_array[$lang['id']]['language_id'] = $lang['id'];
$sql_array[$lang['id']]['products_id'] = $v_products_id;
$sql_array[$lang['id']]['products_name'] = 'new product';
}
foreach ($epLayout['products_description'] as $field_name)
{
if (isset($filelayout['v_' . $field_name . '_' . $lang['code']]))
{
$sql_array[$lang['id']][$field_name] = ep_smart_tags($items[$filelayout['v_' . $field_name . '_' . $lang['code']]], $epControl['smart_tags'][$field_name]);
}
}
} What *I* need to do is somehow add "products_description2" and "products_description3" into this section of code. All attempts by me have resulted in utter failure. Either nothing happens at all (the two new fields are not recognized), or I get a nice happy "foreach" error.
If anyone can help me figure out how to add these two fields into this section of code would be greatly appreciated.
Thanks so much :)
Copied any instance of "products_description" in the easy_populate/easy_populate_import.php file and pasted it twice, changing the next 2 lines to "products_description2" and products_description3" (at lines 339, 774, 775), and the import worked perfectly. Seems like I was overthinking it!