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
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!
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.
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.