You are here:  » change merchant name


change merchant name

Submitted by babrees on Sat, 2012-06-09 06:07 in

Hi David

When registering the datafeeds I use the field to input the merchant's name as my feeds are category based, not merchant.

Some merchants have their name with .co.uk or .com in it, ie "PineSolutions.co.uk". How can I get it to change that to "Pine Solutions" please?

TIA

Submitted by support on Sat, 2012-06-09 13:48

Hi Jill,

In both admin/feeds_filters.php and admin/feeds_filters_configure.php look for the following code at line 4:

  require("../includes/common.php");

...and REPLACE with:

  require("../includes/common.php");
  $config_fieldSet["merchant"] = "Merchant";

With that in place, you'll be able to add filters to the Merchant field; and so Search and Replace can be used in this case...

Cheers,
David.
--
PriceTapestry.com

Submitted by babrees on Tue, 2012-07-10 16:02

Hi David

I am using category datafeeds, so rather than have to keep adding filters to every category is there a way to do this when importing?

TIA
---------
Jill

Submitted by support on Tue, 2012-07-10 16:16

Hi Jill,

Ah sorry, should have mentioned this previously but if you also make the exact same modification to admin/global_filters.php and admin/global_filters_configure.php.

However if you're running a heavily modified earlier distribution prior to the introduction of Global Filters then sure, it can be done within the import record handler code. In includes/admin.php search for the following code around line 342:

if (!$importRecord["merchant"]) return;

...and REPLACE with:

if (!$importRecord["merchant"]) return;
$merchantSearch = array("PineSolutions.co.uk","Example.co.uk","Etc...");
$merchantReplace = array("Pine Solutions","Example","Etc...");
$importRecord["merchant"] = str_replace($merchantSearch,$merchantReplace,$importRecord["merchant"]);

...simply build up the $merchantSearch and $merchantReplace arrays as required for each substitution..,

Cheers,
David.
--
PriceTapestry.com

Submitted by babrees on Tue, 2012-07-10 17:13

Thanks for that David - Sorry I should have explained my setup more!

I made the changes. entered the global search and replace for each of the merchants and reimported feeds but it did not work. Could it be because when registering I do not enter the merchant's name into the field but select the field from the drop down list?

---------
Jill

Submitted by support on Tue, 2012-07-10 17:23

Hi Jill,

Ah yes it will require a bit of juggling of the code in includes/admin.php to create the merchant value before the filters are applied - could you email me your latest version and I'll fix it up for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by philstone on Mon, 2015-02-09 14:48

Hi David

would it be hard to allow global filters to work with the merchant name field?

regards

Phil Stone
www.buy24-7.net

Submitted by support on Mon, 2015-02-09 15:15

Hi Phil,

No problem - in both admin/feeds_filters.php and admin/feeds_filters_configure.php look for the following code at line 10:

  require("../includes/filter.php");

...and REPLACE with:

  require("../includes/filter.php");
  $config_fieldSet["merchant"] = "Merchant";

For 15/01A (beta) that is all you will need to do, but for an existing 14/06A installation, you will also need to modify includes/admin.php in order to populate the `merchant` field before filters are applied. To do this, locate the following code beginning around line 338:

    /* 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"];
    }

...and then relocate that block of code to _above_ the following line, around line 225:

    /* apply user filters */

Cheers,
David.
--
PriceTapestry.com

Submitted by philstone on Mon, 2015-02-09 22:33

David I continue to be amazed by your knowledge and support!!!

Thanks so much!

regards

Phil Stone
www.buy24-7.net
www.checkwebprices.com