You are here:  » Removing Products With No Images

Support Forum



Removing Products With No Images

Submitted by Arya on Sat, 2008-11-08 16:53 in

Hi,

Is it possible to remove products that have no images using the Filter settings?

If so, does anyone know how to go about this please?

Thanks very much,

Arya Marafie.

Submitted by support on Sat, 2008-11-08 17:56

Hello Arya,

Do you want to do this on a feed-by-feed basis, or globally?

Globally can be done quickly and easily by adding a condition to the import record handler function. In includes/admin.php you will find this starting at line 155:

    /* check product record for minimum required fields */
    if (!$record[$admin_importFeed["field_name"]] || !$record[$admin_importFeed["field_buy_url"]] || !$record[$admin_importFeed["field_price"]]) return;

To make images mandatory, change this to:

    /* check product record for minimum required fields */
    if (!$record[$admin_importFeed["field_name"]] || !$record[$admin_importFeed["field_buy_url"]] || !$record[$admin_importFeed["field_price"]] || !$record[$admin_importFeed["field_image_url"]]) return;

Cheers,
David.

Submitted by babrees on Sun, 2009-10-18 08:17

Unfortunately, they seem to be putting in a url to a "no image" image so this doesn't work.

I remedied this with the worst culprit by have a drop record filter, but is it at all possible to remove it globally if "noimage" is in the url?

---------
Jill

Submitted by support on Mon, 2009-10-19 09:47

Hi Jill,

Sure; to do this within includes/admin.php, immediately AFTER the block of code described in the first comment in this thread (but not as a replacement of it), add the following code;

  if (strpos($record[$admin_importFeed["field_image_url"]],"noimage")!==FALSE)
  {
    $record[$admin_importFeed["field_image_url"]] = "";
  }

..and that will empty the image_url field, meaning your theme's no image code can take over and display a local "no image available" image...

Cheers,
David.