You are here:  » Explode filter on merchant

Support Forum



Explode filter on merchant

Submitted by marco@flapper on Wed, 2012-02-29 14:30 in

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?

Submitted by support on Wed, 2012-02-29 14:39

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

Submitted by marco@flapper on Wed, 2012-02-29 20:04

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.

Submitted by support on Thu, 2012-03-01 08:11

Hi Marco,

If you'd like to email me your modified includes/admin.php and a link to the feed that you're applying the filter to and field name / return index values I'll check it on my test server for you...

Cheers,
David.
--
PriceTapestry.com