Hey everyone, I know that there have been a few that have had problems using EP4 when it comes to not wanting to deal with the product description. So, I finally sat down and worked through the code myself and here is a solution that works with the current version (v4.022) available from the first post of this thread, and soon to be available in the fork of the code that I have made. In the mean time, if you modify the import file that is located in the admin directory:
ROOT_OF_STORE/admin/easypopulate_4_import.php
Find the code that includes:
Code:
// BEGIN: Products Descriptions
...
...
...
} // END: Products Descriptions End
Code:
// BEGIN: Products Descriptions
// the following is common in both the updating an existing product and creating a new product
if (isset($v_products_name)) {
foreach ($v_products_name as $key => $name) {
$sql = "SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " WHERE
products_id = " . $v_products_id . " AND
language_id = " . $key;
$result = ep_4_query($sql);
if (mysql_num_rows($result) == 0) {
$sql = "INSERT INTO " . TABLE_PRODUCTS_DESCRIPTION . " (
products_id,
language_id,
products_name, " .
((isset($filelayout['v_products_description_' . $key]) || ( isset($filelayout['v_products_description_' . $key]) && $product_is_new) ) ? " products_description," : "");
if ($ep_supported_mods['psd'] == true) {
$sql .= " products_short_desc,";
}
$sql .= " products_url )
VALUES (
'" . $v_products_id . "',
" . $key . ",
'" . addslashes($name) . "', " .
((isset($filelayout['v_products_description_' . $key]) || ( isset($filelayout['v_products_description_' . $key]) && $product_is_new) ) ? "'" . addslashes($v_products_description[$key]) . "'," : "");
if ($ep_supported_mods['psd'] == true) {
$sql .= "'" . addslashes($v_products_short_desc[$key]) . "',";
}
$sql .= "'" . addslashes($v_products_url[$key]) . "')";
$result = ep_4_query($sql);
} else { // already in the description, update it
$sql = "UPDATE ".TABLE_PRODUCTS_DESCRIPTION." SET
products_name ='".addslashes($name)."', " .
((isset($filelayout['v_products_description_' . $key]) || ( isset($filelayout['v_products_description_' . $key]) && $product_is_new) ) ? "products_description ='" . addslashes($v_products_description[$key]) . "'," : "");
if ($ep_supported_mods['psd'] == true) {
$sql .= " products_short_desc = '" . addslashes($v_products_short_desc[$key]) . "',";
}
$sql .= " products_url='" . addslashes($v_products_url[$key]) . "'
WHERE products_id = '" . $v_products_id . "' AND language_id = '" . $key . "'";
$result = ep_4_query($sql);
}
}
} // END: Products Descriptions End
I tested this with an update of a single record. Perhaps some confirmation of functionality?
The product_name is still an attribute that should remain. This targets the import of files that do not have the following prefixes: categorymeta-ep nor attrib-. If the file(s) have that prefix then the above code will not be processed.
Bookmarks