You are here:  » Replacing noimage images from merchants?

Support Forum



Replacing noimage images from merchants?

Submitted by paul30 on Tue, 2008-10-14 10:07 in

Hello David, will it be easy to replace the URLs of all the noimage images from merchants with a custom noimage file URL? I mean perhaps with an SSH command after import??

The URLs of the "noimage" images that I got from merchants are similar to:

http://www.SITEADDRESS.com/fullsize/http://www. SITEADDRESS.com/Merchant2/graphics/00000001/imagecomingsoon.jpg

Thanks
Pasha

Submitted by support on Tue, 2008-10-14 10:23

Hi Pasha,

It could be done quite efficiently during import; just before inserting into the database. If you search for the following comment in includes/admin.php (around about line 275):

/* create product record */

....you could use something like this immediately prior to that line:

if
(
strpos( $record[$admin_importFeed["field_image_url"]] , "comingsoon" )
||
strpos( $record[$admin_importFeed["field_image_url"]] , "noimage" )
||
strpos( $record[$admin_importFeed["field_image_url"]] , "nopicture" )
)
{
  $record[$admin_importFeed["field_image_url"]] = "http://www.yoursite.com/images/noimage.jpg";
}

...simply edit / add to the list of strpos entries to catch all the different types of "no image" URLs you come across in your feeds...

Cheers,
David.

Submitted by paul30 on Tue, 2008-10-14 16:29

Thanks, cheers!

Submitted by paul30 on Wed, 2008-10-15 00:05

I am sorry, but I dont always follow your code (it is too advanced for me) and I think I got confused...

If the image URL I need to replace is

http://www.MERCHANT-SITE.com/Merchant2/graphics/00000001/imagecomingsoon.jpg

should I have something like:

strpos( $record[$admin_importFeed["field_image_url"]] , "imagecomingsoon" )

OR

strpos( $record[$admin_importFeed["field_image_url"]] , "http://www.MERCHANT-SITE.com/Merchant2/graphics/00000001/imagecomingsoon.jpg" )

Thanks in advance!

Submitted by support on Wed, 2008-10-15 07:31

Hi Pasha,

It's the first - as all it's doing is looking for a part of the URL (a "signature" if you like) that indicates that it's a no-image URL...

Cheers,
David.