
Originally Posted by
drgr33n
Just a little more info it turns out that to use this mod all model numbers has to be unique :/ Weird but thats how it is so if anyone else experience what I was change the model numbers to some crap lol
I was having the same issue since I didn't use model numbers initially. With about 150 things in the store now I didn't want to go through and edit them all to include model #'s
I decided to edit the program to automatically create the model number based off the product_id since it will be unique to each product. You can copy and paste this code into the /admin/easypopulate.php file. If you haven't already altered it, I believe it is at line 731 where you put it.. included some of the surrounding code so you can find it:
PHP Code:
if ($ep_dltype == 'froogle'){
$endofrow = "\n";
} else {
// default to normal end of row
$endofrow = $separator . 'EOREOR' . "\n";
}
$filestring .= $endofrow;
$num_of_langs = count($langcode);
while ($row){
////////////////////////////////////////////////////
// BEGIN: Set blank product_model to product id //
////////////////////////////////////////////////////
// Check if products_model in the current row is blank
if ($row[1] == '' || $row[1] == Null){
// if it is blank, create and run an sql query updating it to the product_id
$queryTHIS = 'UPDATE '.TABLE_PRODUCTS.'
SET
products_model="'.$row[0]. '"
WHERE
(products_id = "'. $row[0] . '")';
$result123 = ep_query($queryTHIS);
// this just changes the v_model in the output file without querying
// the server for it, since it was just changed
if ($result123){
$row[1] = $row[0];
}
}
//////////////////////////////////
// END: Set blank product_model //
//////////////////////////////////
// if the filelayout says we need a products_name, get it
// build the long full froogle image path
// check for a large image else use medium else use small else no link
// thanks to Tim Kroeger - www.breakmyzencart.com
$products_image = (($row['v_products_image'] == PRODUCTS_IMAGE_NO_IMAGE) ? '' : $row['v_products_image']);
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = ereg_replace($products_image_extension . '$', '', $products_image);
PLEASE BACKUP YOUR DATABASE BEFORE USING. It worked for me perfectly, but I don't wanna be blamed if something blows up. It hasn't been tested further than running it, making sure the site/database were still good, then deleting a couple of the models manually through admin and running again.
Bookmarks