Hi David
How can I drop all records during import that are below a certain price point? Is there a filter for this? Let's say, I want to drop all records below 100USD.
Kind regards,
IG
Hi David
This works perfectly. Thank you.
I trying to get my head around about the following problem and wonder if you have a solution for me:
Let's say I import all products with a price > 100USD of feed A. All these products have an EAN code. Now I would like to import all products < 100USD of feed B plus all products of feed B that are > 100USD, but have the same EAN code of the already imported products of feed A.
Probably, I would need a filter or a script that drops all products below a certain price level after they have been matched by EAN.
Can you think of a way that this would be possible?
Cheers,
IG
Hello IG,
You could hard code this relatively easily into a post import query having imported all of feed B (so no price range filter). The easiest place to add post-import queries that run after every import method is in the admin_importReviews() function in includes/admin.php. To give this a go, look for the following code at line 748:
global $config_databaseTablePrefix;
...and REPLACE with:
global $config_databaseTablePrefix;
$sql = "SELECT ean FROM `".$config_databaseTablePrefix."products` WHERE filename='feed A'";
database_querySelect($sql,$rows);
$ins = array();
foreach($rows as $row)
{
$ins[] = "'".database_safe($row["ean"])."'";
}
$in = implode(",",$ins);
$sql = "DELETE FROM `".$config_databaseTablePrefix."products` WHERE filename='feed B' AND price > '100.00' AND ean NOT IN (".$in.")";
database_queryModify($sql,$result);
Just replace feed A and feed B with the actual filenames and that (memory permitting) should do the trick. If this doesn't work because feed A is huge and the ean list is too big to fit into memory let me know and I'll work it out as a buffered query for you...
Cheers,
David.
--
PriceTapestry.com
Hello IG,
Sure, there is a Price Range filter in this post to do exactly that - you can specify a minimum, maximum or both to filter by...
Cheers,
David.
--
PriceTapestry.com