You are here:  » Remove Brand for one merchant

Active Forum Topics


Remove Brand for one merchant

Submitted by Perce2 on Fri, 2020-06-19 09:14 in

Hi David,

I have one merchant who doesn't provide product brand information, instead they provide a numerical code like 4486803718255 for each product.

On my Brands page I have 1,000's of these useless codes ({link saved}). Is there a way to remove them as they don't serve any purpose?

Thanks.

Submitted by support on Fri, 2020-06-19 10:15

Hi,

If you are using individual feeds for each merchant don't forget that you could just re-register the feed for this merchant and don't register a field for the Brand - if the field has auto-detected on Feed Registration Step 2 you can changed the drop down back to "Select field..." when re-registering so that brand is not imported.

Otherwise for a multi-merchant feed, it's probably easiest as a simple mod to includes/admin.php - search for the following comment (common to all distributions)

  /* check product record for minimum required fields */

...and immediately before that line, add:

  if ($importRecord["merchant"]=="Merchant Name")
  {
    $importRecord["brand"] = "";
  }

Edit Merchant Name as the exact merchant name as it appears on the site and re-import to remove brand IDs in this case...

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Sun, 2020-06-21 09:47

Hi David, thanks for your suggestions.

I had already tried your first idea "Select field...", as I use individual feeds. Unfortunately the script doesn't seem to allow this and won't import anything. Only if I choose the "brand" field in my feed will it import.

Can it be done by adding a filter for that merchant?

Thanks

Submitted by support on Mon, 2020-06-22 06:40

Hi,

Sure - an "Unset" filter to clear down the value of any field is no problem - here's the code to add to includes/filter.php...

  /*************************************************/
  /* unset */
  /*************************************************/
  $filter_names["unset"] = "Unset";
  function filter_unsetConfigure($filter_data)
  {
    print "<p>There are no additional configuration parameters for this filter.</p>";
  }
  function filter_unsetValidate($filter_data)
  {
  }
  function filter_unsetExec($filter_data,$text)
  {
    return "";
  }

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Fri, 2020-06-26 11:41

Perfect!

Thanks David