You are here:  » Disabled merchant, without deletion


Disabled merchant, without deletion

Submitted by sirmanu on Fri, 2017-07-14 12:41 in

Hi David.
Is it possible to disable a feed(not import it) but letting intact the data of filters, data mapping and jobs?
I have a couple of merchants witch are not commissioning this summer but they will do it again in next months.
Thanks!

Submitted by support on Fri, 2017-07-14 13:00

Hi,

You could do this by temporarily adding an instance of the existing filter "Drop Record RegExp" against the Product Name field using a "Drop record if field matches regular expression" value of:

/(.*)/

...which will match anything, and therefore drop all records for that feed (as long as it is the last filter in sequence).

However, it may be desirable to create a new filter that simply sets the $filter_dropRecordFlag flag regardless, and this way you will be able to easily identify the filter that is temporarily disabling that feed in the filters list. To do this, add the following new code to includes/filter.php, immediately before the closing PHP tag:

  /*************************************************/
  /* dropRecordTemp */
  /*************************************************/
  $filter_names["dropRecordTemp"] = "Drop Record Temp";
  function filter_dropRecordTempConfigure($filter_data)
  {
    print "<p>There are no additional configuration parameters for this filter.</p>";
  }
  function filter_dropRecordTempValidate($filter_data)
  {
  }
  function filter_dropRecordTempExec($filter_data,$text)
  {
    global $filter_dropRecordFlag;
    $filter_dropRecordFlag = TRUE;
    return $text;
  }

With that in place, for a feed that you wish to temporarily disable add a new "Drop Record Temp" to the Product Name field (not that it matters which field you use!) and then for as long as the filter is in place no products will be imported for that feed...

Cheers,
David.
--
PriceTapestry.com

Submitted by sirmanu on Sun, 2017-07-16 22:12

Ok. Should I also modify sitemap.php to not have errors in Google Search Console?

For example:

 $sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds` WHERE imported > 0 AND products > 0 ORDER BY filename";

Submitted by support on Mon, 2017-07-17 07:13

Hi,

Yes - that modification will work fine to remove feeds that are registered but with no products imported from the sitemap...

Cheers,
David.
--
PriceTapestry.com