Hi,
I have Easy Populate on my cart (Actually just purchased Easy Populate Advanced, but doesn't seem to do what I wanted either)
When I export my Attributes CSV, it is missing two important fields - attributes_price_factor and attributes_price_onetime
How can it be missing these? Those are the most important things with the attributes!
How can I modify the code to export those two fields into the CSV, and also update them on an upload? The code isn't easy to work with
I'm assuming it's somewhere in here?
Thanks!PHP Code:case 'attrib':
if (isset($ep_debug)) $attrstart = ep_timer();
$attribute_options_array = array();
$attribute_options_values =& ep_query("select distinct products_options_id from (" . TABLE_PRODUCTS_OPTIONS . ") order by products_options_id");
for ($i = 0; $attribute_options = $attribute_options_values->getRow($i, ECLIPSE_DB_ASSOC); $i++)
{
$attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']);
}
if (isset($ep_debug)) ep_timer($attrstart,'Attributes');
if (isset($ep_debug))
{
$attr3start = ep_timer();
}
$iii = 0;
$filelayout = array(
'v_products_id' => $iii++,
'v_products_model' => $iii++
);
$header_array = array();
$attribute_options_count = 1;
foreach ($attribute_options_array as $attribute_options_values)
{
$key1 = 'v_attribute_options_id_' . $attribute_options_count;
$header_array[$key1] = $iii++;
for (reset($ep_languages); list(, $lang) = each($ep_languages);)
{
$key2 = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lang['code'];
$header_array[$key2] = $iii++;
}
$attribute_values_values =& ep_query("SELECT products_options_values_id FROM (" . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . ") WHERE products_options_id = '" . (int)$attribute_options_values['products_options_id'] . "' ORDER BY products_options_values_id");
$attribute_values_count = 1;
for ($i = 0; $attribute_values = $attribute_values_values->getRow($i, ECLIPSE_DB_ASSOC); $i++)
{
$key3 = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;
$header_array[$key3] = $iii++;
$key4 = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count;
$header_array[$key4] = $iii++;
for (reset($ep_languages); list(, $lang) = each($ep_languages);)
{
$key5 = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lang['code'];
$header_array[$key5] = $iii++;
}
$attribute_values_count++;
}
$attribute_options_count++;
}
$filelayout = array_merge($filelayout, $header_array);
$filelayout_sql = 'SELECT
products_id as v_products_id,
products_model as v_products_model
FROM
(' . TABLE_PRODUCTS . ')
';
if (isset($ep_debug))
{
ep_timer($attr3start,'Attributes 3');
}
$dl_filename = EASYPOPULATE_EXPORT_PREFIX_ATTRIBUTES;
break;


Reply With Quote
