Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Reference product image by supplier url or http://


Recommended Posts

Product Image by URL



* Updated by Dutch, thanks to the original code from the below authour. *

* Cleaned up the code and translated it from German to English *

* ///// Orginal Author: Klaus Koester/// *


* This conntribute allows you to reference an enternal url for your *

* product image. Put the reference in the database field products_image *

* using excel or easy populate etc http://www.supplier-domain/images/123.jpg *

* once the url is in the field the code will check to see if the image resides *

* locally, if so it show it if external it follows the url to display the *

* image. *


* Issues: I use jqzoom so upon mouse over you can see the external url *

* anyone can offer a fix that says basically if the img is http:// then *

* avoid the jqzoom or pop up option on the page and show nothing *

that would be excellent. *





Edit the following file;

edit this file: catalog/includes/functions/html_output.php



// The HTML image wrapper function

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

return false;


----- Add After The Above ------

// Display images coming fron everywhere on the net.

// To do this, place an URL of the picture into the image-field of your shop.


if (substr_count ($src, "http://")) {

$src = stristr ($src, "http://");





What makes the product images with osCommerce?

It writes an images / before the image name so images / image.jpg or so.

Then the html code is generated ie: <img src = "images / image.jpg ...


Well, what do the two inserted rows?

The look easy, whether it is in the image name, type http://.

If not, nothing happens and takes the old code.

If so, everything is deleted before the http://.


So if you now want to distribute your images in subdirectories

then you add those two lines and referencing your images to:



Advantage: I can reference the images locally or remotely.

Disadvantage: does not like in making these changes, but in the field of Feldlaenge

which includes the image name. I believe I have now looked up again 64 without.

But yes you can customize.



is not offered



is not taken over



Ae email concerning experience with this contrib I would be very nice; [email protected]

Knowledge is useless, unless transferred.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...