Hi David,
I have two filters that I need to apply. One should be simple for you, the other might not be possible.
1.) I have a feed that contains some ZERO priced items as 0.00 in the price field. I would like to drop these records upon import. I actually haven't tried it yet but I believe the drop record on price like 0.00 would drop the records but also drop other records that end in 0.00 ... like 10.00 and 20.00 etc. Am I correct or can I just use the existing filter? Also, I came across something you had written specifically for Amazon.com, but I couldn't apply this to my feed.
2.) This one appears a bit harder... I'm currently importing a feed using the filter "Drop Record If Not RegExp" with (Boots|Casual Shoes|Dress Shoes|High Heels|Sandals) on the description field. I would like to be able to set the category field equal to one of these values also. Therefore, I'm predetermining my categories and only importing products that relate to those categories. I don't have to rely on other peoples category names and don't have to use your category mapping feature which seems difficult on a site with 1,000,000+ items. I'm hoping I can do this at import time with a custom filter, without having to reprocess the records.
Thank You for any help you can provide with this!
Lang
David,
Just wanted to say thanks for your response. Both worked for me!
Lang
hi dave
hope all is well with yourself,
just wondering how this '0.00 stop import process' works in the latest script?
cant seem to find the lines in the includes/admin.php file
regards
Phil Stone
www.buy24-7.net
Hi Phil,
In the latest version; look for the following code starting at line 274:
/* decimalise price */
$importRecord["price"] = tapestry_decimalise($importRecord["price"]);
...and REPLACE with:
/* decimalise price */
$importRecord["price"] = tapestry_decimalise($importRecord["price"]);
if ($importRecord["price"]=="0.00") return;
Hope this helps!
Cheers,
David.
thanks dave
i tried this but was wondering as i am using delivery costs would this be preventing this working?
Code at present is
/* decimalise price */
$importRecord["price"] = tapestry_decimalise($importRecord["price"]);
if ($importRecord["price"]=="0.00") return;
$importRecord["delivery"] = tapestry_decimalise($importRecord["delivery"]);
$importRecord["price"] = $importRecord["price"] + $importRecord["delivery"];
Phil Stone
www.buy24-7.net
Hi Phil,
That looks fine - after a re-import (this part of the code is only applied at import time) are you still getting prices as 0.00 for the merchant just imported?
Cheers,
David.
yeah i reimported a feed but the 0.00 results still imported with the feed
regards
Phil Stone
www.buy24-7.net
Hello Lang,
Regarding 1), that would be easy to implement within the import record handler function in includes/admin.php. To do this, look for the following code on line 168:
$record[$admin_importFeed["field_price"]] = tapestry_decimalise($record[$admin_importFeed["field_price"]]);
...and REPLACE this with:
$record[$admin_importFeed["field_price"]] = tapestry_decimalise($record[$admin_importFeed["field_price"]]);
if ($record[$admin_importFeed["field_price"]]=="0.00") return;
Regarding 2), The Category Mapping feature should enable you to do this, as the user filters are applied before the mapping. Taking the above example, if you wanted all products in those categories to be imported as "Footwear", then create a new master category called "Footwear" (in Admin > Category Mapping), and on the configuration page, enter the same values (one per line) as you are using in the filter...
Hope this helps!
Cheers,
David.