Hi,
I'm using the explode filter http://www.pricetapestry.com/node/2017 but I also want to use it on the merchant name field.
How should I modify filter.php?
Hi,
I put the modifications in but it doesn't import anything. I tried to import without the filter but that import doesn't work too.
Hi Marco,
Firstly, the merchant value in includes/admin.php needs to be moved to above the point at which filters are applied. Look for the following code beginning around line 330:
/* construct merchant value */
if ($admin_importFeed["field_merchant"])
{
$importRecord["merchant"] = $record[$admin_importFeed["field_merchant"]];
$importRecord["merchant"] = tapestry_normalise($importRecord["merchant"],"\.");
}
else
{
$importRecord["merchant"] = $admin_importFeed["merchant"];
}
Cut the above, and paste back in ABOVE the following comment:
/* apply user filters */
(line 216).
With that in place, next in admin/feeds_filters.php look for the following code at line 62:
$fields = array();
...and REPLACE with:
$fields = array();
$fields["merchant"] = "Merchant (".$feed["field_merchant"].")";
And finally in admin/feeds_filters_configure.php look for the following code at line 24:
$fields = array();
...and REPLACE with:
$fields = array();
$fields["merchant"] = "Merchant (".$feed["field_merchant"].")";
With the above in place you should then be able to apply filters to the merchant field (when registered as a field rather than entered specifically)
Cheers,
David.
--
PriceTapestry.com