
Originally Posted by
any_way
hello chadd,
your plugin works fine, is it possible to add "v_products_name" to export file "Model/Price/Qty"?
Output "Model/Price/Qty" like this example:
v_products_model,v_products_name,v_status,v_specials_price,v_specials_date_avail ,v_specials_expires_date,v_products_price,v_products_quantity

Originally Posted by
any_way
no solution mc123456... relating to my post on 08/24/2013
please answer with a simple yes or no.
Wow... My apologies. I can generate a solution. Not a difficult add in, at least if just want to have the data displayed on the screen. If want the program to use the data, that may take a little more. Below is the changes to show the products name (multilingual potential) for the product model being discussed when doing price quantity discounts. It does not necessarily import that data back into the database. (Haven't looked through the import code, nor did I see that it was expected to import the name.) So this is just for user benefit when updating the other fields.
In admin/includes/functions/extra_functions/easypopulate_4_functions.php
Main code section: function ep_4_set_filelayout
At the case for priceqty: (Add the foreach statement after the first $filelayout and before the next $filelayout... This forces the name to be after the model...)
PHP Code:
case 'priceqty':
$filelayout[] = 'v_products_model';
foreach ($langcode as $key => $lang) { // create variables for each language id
$l_id = $lang['id'];
$filelayout[] = 'v_products_name_'.$l_id;
}
$filelayout[] = 'v_status'; // 11-23-2010 added product status to price quantity option
in admin/easypopulate_4_export.php find the end of the 'full' routine as shown below, insert the text in red (oops, used php tags... There is no custom coloring for PHP tags so the code area as described) before the //BEGIN: Specials. (This just happens to be a convenient location and is not required to be at that specific point in the code. There is an area lower in the code that addresses the calculations of the priceqty discount; however, after quickly coding this, it seemed like this area still may be preferred. The lower area is heavy in math and affects of performing a discount and not so much in the other "random" data to be exported.
PHP Code:
} // if($ep_dltype == 'full')
if ($ep_dltype == 'priceqty') {
foreach ($langcode as $key => $lang) {
$lid = $lang['id'];
$sql2 = 'SELECT * FROM '.TABLE_PRODUCTS_DESCRIPTION.' WHERE products_id = '.$row['v_products_id'].' AND language_id = '.$lid.' LIMIT 1 ';
$result2 = ep_4_query($sql2);
$row2 = mysql_fetch_array($result2);
$row['v_products_name_'.$lid] = $row2['products_name'];
} // end foreach $langcode
} //end if ($ep_dltype == 'priceqty')
// BEGIN: Specials