Post by kryul » Sat Oct 13, 2018 6:23 am

Hi Experts,

I am very newbie into OC Store, and I am asking you for help.

I am using a bulk upload of products (XLSX) into my ocstore shop.
image_name is set as

As long as we have more that 10 000 products, I would not like to duplicate (copy) the images into our web_site, too. I would prefer to use remote files and display them as images at my shop's page.

ISSUE: Import was successful. However, I do not see the images in Administration cockpit in Products/Image area.
Also the images are not displayed at our shop during runtime.

1) allow_url_fopen = on (in a root folder of our site in php.ini)
2) Import/Export was implemented via <<Export/Import Tool (V3.9) for Ocstore 2.x>>
3) the mentioned remote URLs can be successfully open in a browser

I fully understand that ocstore engine is using DIR_IMAGE which is defined as the next
define('DIR_IMAGE', '/home/my_shop/workspace/sites/');

Is there any way to force ocstore engine in some cases (because I also have a set of images in <<>> and I want them to be displayed fine too) to use remote URLs as they are
is the any way to solve my problem? What is a standard solution for this issue?



Fri Oct 12, 2018 4:51 am

Post by straightlight » Sun Oct 14, 2018 7:47 pm

ISSUE: Import was successful. However, I do not see the images in Administration cockpit in Products/Image area.
Also the images are not displayed at our shop during runtime.
The images were imported but the relative paths from the database in your product and product image database tables may be invalid while the image filenames may still exist on your file server. A simple query may need to be used to update those paths. However, it may have to be ran multiple times since you claim to handle more than 10000 products.

In addition, since you are using an extension, contact the extension developer to solve this issue with your image paths.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Straightlight Administrator / Quality Assurance Analyst / Programmer

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by IP_CAM » Mon Oct 15, 2018 6:39 am

Well, the good old OC standard way, to HTTP(S) - link images, would be,
to define HTTP(S):// image Links, in one or both of your config.php Files,

Code: Select all

define('HTTP_SERVER', '');
define('HTTP_IMAGE', ''); // SUBDOMAIN-LIKE Link
define('HTTPS_SERVER', '');
define('HTTPS_IMAGE', ''); // SUBDOMAIN-LIKE Link
and in the catalog/model/tool/image.php file, change the internal PATH linking,

Code: Select all

if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
	return $this->config->get('config_ssl') . 'image/' . $new_image;
	} else {
	return $this->config->get('config_url') . 'image/' . $new_image;
to HTTP(S) linking:

Code: Select all

if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
// return $this->config->get('config_ssl') . 'image/' . $new_image;  // OLD CODE
	return HTTPS_IMAGE . $new_image;
	} else {
// return $this->config->get('config_url') . 'image/' . $new_image;  // OLD CODE
	return HTTP_IMAGE . $new_image;
to make images be called by HTTP(S). The advantage of this is, that Images
can be linked, to make it look, for Site Performance Tests, like a cookiefree
SubDomain Linking, which adds remarkably to overall Performance Results.

And there are other OC Files, where such Lines exist, depending on the OC Version
( and Extensions/Themes ! ) used, containing this:

Code: Select all

$this->config->get('config_url') . 'image/'
$this->config->get('config_ssl') . 'image/'
you just have to seach for those Lines, to find out, in which files that Code exists, to also
change them, either by use of a VqMod (or OcMod), or then directly in the Source File itself.
I added a VqMod, to let you see, how such can be solved as well, by OcMod or VqMod.

It's one of those things, working the same in all OC Version from 1.5.6.x UP, where it no longer
was default part of it. The ONLY Difference might be, that the $new_image Variable
might be named $image_new in your Version OC, so check on this first !

But since Images can only be managed by ADMIN, if they are linked, to be accessable by
Admin, meaning, that they have to reside on the same Server, this way at least. And for
Admins, it might be easier, to leave the Admin config-linking the default Image-PATH Way,
since this has no influence on the final front side 'output'-Link !

And for 'real' externally hosted Images, some Extensions exist, as I recall,
like: ... n_id=32885 ... n_id=26681

Good Luck! ;)

PS: The VqMod also add's the otherwise still MISSING image width + height TAG's.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<id><![CDATA[HTTP_IMAGE + HTTPS_IMAGE Links and Sizes]]></id>
<version><![CDATA[OS v.]]></version>
<author><![CDATA[Ernie - IP_CAM]]></author>
<file name="catalog/model/tool/image.php">
<operation error="skip">
<search position="replace"><![CDATA[return $this->config->get('config_ssl') . 'image/' . $new_image;]]></search>
<add><![CDATA[return HTTPS_IMAGE . $new_image . '" width="' . $width . '" height="' . $height;]]></add>
<operation error="skip">
<search position="replace"><![CDATA[return $this->config->get('config_url') . 'image/' . $new_image;]]></search>
<add><![CDATA[return HTTP_IMAGE . $new_image . '" width="' . $width . '" height="' . $height;]]></add>

<file name="catalog/controller/payment/skrill.php,catalog/controller/total/voucher.php,catalog/model/checkout/order.php,catalog/model/tool/image.php" error="skip">
<operation error="skip">
<search position="replace"><![CDATA[$this->config->get('config_url') . 'image/']]></search>
<operation error="skip">
<search position="replace"><![CDATA[$this->config->get('config_ssl') . 'image/']]></search>

I'm rarely active at the OC Forum lately. To reach me, contact:
A Demoversion of my free OpenCart LIGHT v. Software Edition
can be seen in real Action here:
1'200+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site:

User avatar
Legendary Member


Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 4 guests