Hi David,
Sorry about the title. Not too sure how to phrase it, and there is 2 different questions relating to the same thing, so kind of confusing !!
I'm currently trying to setup a niche DVD site with around 100 products and hoping to use around 10 merchant feeds. I will download all of the feeds first and import them using the admin interface. As I mentioned in another thread, the Play.com has over 30000 products but I don't want them all to appear on my site. I have used the selective import filter before to import only certain categories but never used it for products. I'm also looking to change all of the names of the products using your Product Mapping feature.
What do you reckon would be the best way to go about it.
Part 1
Would I
1) Register & Import the feeds
2) Perform the product mapping
3) Enter the new 100 product names in a list separated by the pipe character in the selective import box.
4) Import all feeds again
Part 2
I have the list of new product names made out with some extra information which isn't in every feed, as follows.
TITLE| RRP | CATEGORY
Ricky Hatton: A Life Story|11.99|Boxing
Rugby World Cup 2007 |14.99|Rugby
Do you know of any way that I could have the category for each product taken from this list rather than using the merchants category as they differ between merchants. Also would like to do the same with the RRP info.
Can you see any easy way to go about this bearing in mind I would like to update the merchant feeds on a regular basis and would like to add more products as time goes on.
Hope this makes sense :)
Thanks
Adrian
Hi Adrian,
Ultimately, it will be quite easy to prevent imporing of anything except products within a list of names; but the best way to do it depends on how big that list is.
What format do you currently have the list in, and how long is it?
Also, have you already setup product mapping on a "per feed" basis?
Cheers,
David.
Hi David,
Thanks for looking at this.
The list will only ever have between 100 200 products, so not that large. Have the list in a spreadsheet and could upload it into a database table if that would be better.
Only working on a few small test feeds to see if product mapping and selective import would work together. Product mapping is setup using your admin interface and once each feed is imported, the product names change as per the mapping. I can email you on the list, url etc. if that will make more sense.
Thanks
Adrian
Hi Adrian,
If you can export from the spreadsheet just the list of valid titles, one per line, the easiest thing to do will be to load this in at import time, and then check each product against it.
Assuming a file called titles.txt, stored in the Price Tapestry installation directory, with a format as follows:
Title 1
Title 2
etc...
etc...
Then, in includes/admin.php, look for the following code on line 322 of the original version (within the admin_import() function):
global $admin_importCallback;
...and add the following code immediately afterwards:
global $admin_selectiveImport;
$fp = fopen("../titles.txt","r");
while(!feof($fp))
{
$title = trim(fgets($fp));
$admin_selectiveImport[$title] = 1;
}
And then, further up the file, within the import record handler, look for the following code (line of the original version):
if ($filter_dropRecordFlag) return;
...and add the following new code immediately afterwards:
global $admin_selectiveImport;
if (!$admin_selectiveImport[$record[$admin_importFeed["field_name"]]]) return;
Hope this helps!
Cheers,
David.
Hi David,
Tried all the above and ran an import, and now no products being imported. Have just sent you an email with my new admin.php and txt file, which you might look at when you get a change.
Much appreciated.
Adrian
Hi David,
A mistake with my text file as you pointed out. Working great now.
Thanks again :)
Adrian
Hi David,
I got the product mapping and selective import working together by moving the product mapping filter above the user filters in includes/admin.php. Looking at including the selective import filter in admin.php so I don't have to create one for each feed.
Not too sure what to put in, any ideas?
Thanks
Adrian