Page 1 of 1

define HTTP_IMAGE ??

Posted: Fri Feb 27, 2015 6:51 pm
by clinton4
Hi,

Ref: http://forum.opencart.com/viewtopic.php?f=138&t=40573

I have done as described in the post above, but images is still served from my main domain and not the subdomain i have defined. Why?

I'am running 1.5.6.4

Re: define HTTP_IMAGE ??

Posted: Fri Feb 27, 2015 8:00 pm
by IP_CAM

Re: define HTTP_IMAGE ??

Posted: Fri Feb 27, 2015 8:10 pm
by clinton4
That did not solve my problem at all. If HTTP_IMAGE is removed, how can achive this http://forum.opencart.com/viewtopic.php?f=138&t=40573

Re: define HTTP_IMAGE ??

Posted: Fri Feb 27, 2015 10:53 pm
by IP_CAM
The advise, given on the Page you mentioned, is not complete, you have to check the ZIPPED images, as informed on the Page, linked above, to get what you are looking for. There is no other solution, I did it several times and it works, if done as advised.

Ernie
bigmax.ch
sample site, used with this kind of mod.

Re: define HTTP_IMAGE ??

Posted: Fri Feb 27, 2015 11:01 pm
by clinton4
Hi,

I already understand the concept. What i do not understand is how to achieve this when define HTTP_IMAGE is removed from OC 1.5.X

How am i suppose to dynamically change URL source for just images when there is no place to define a custom URL for images?

Re: define HTTP_IMAGE ??

Posted: Sun Mar 01, 2015 2:34 am
by IP_CAM
>> how to achieve this when define HTTP_IMAGE is removed from OC 1.5.X <<
If I understud your question, you can't achieve it, if the definition of the HTTP_IMAGE is removed from the config file. How should you..., or better, why ?
Ernie

Re: define HTTP_IMAGE ??

Posted: Wed Mar 11, 2015 2:01 am
by clinton4
Problem is solved.

Qphoria created a vqmod to add the HTTP_IPAGE back. You can find it at the bottom of the follwong post:
http://forum.opencart.com/viewtopic.php?f=138&t=40573

Thanks Qphoria :)

Re: define HTTP_IMAGE ??

Posted: Thu Mar 12, 2015 3:11 am
by IP_CAM
But just make sure, not to copy the Error from the VqMod and put the error line into your config.php's, it won't work.

>>bigmax.ch\shop\catalog\model\tool\image.php

Code: Select all

<!-- BEFORE USE, YOU MUST ADD THIS TO YOUR config.php FILE
-- START Error Line
    define('HTTP_IMAGE', 'http://www.yoursite.comimage/');
-- END Error Line
Should be:
    define('HTTP_IMAGE', 'http://www.yoursite.com/image/');
--
    define('HTTPS_IMAGE', 'http://www.yoursite.com/image/');
    -->
Additionally:

Code: Select all

<file name="catalog/*/*/*.php" error="skip">
        <operation error="skip">
        <search position="replace"><![CDATA[
        $this->config->get('config_url') . 'image/'
        ]]></search>
        <add><![CDATA[
	HTTP_IMAGE
SHOULD RATHER BE:
        HTTP_IMAGE . $new_image;
	]]></add>
        </operation>

	<operation error="skip">
        <search position="replace"><![CDATA[
        $this->config->get('config_ssl') . 'image/'
        ]]></search>
        <add><![CDATA[
	HTTPS_IMAGE
SHOULD RATHER BE:
        HTTPS_IMAGE . $new_image;
	]]></add>
acording to my informations and my working V.1.5.6.x System

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;
			return HTTPS_IMAGE . $new_image;
		} else {
			// return $this->config->get('config_url') . 'image/' . $new_image;
			return HTTP_IMAGE . $new_image;
		}	
I am not so sure, if it makes a lot of sense, to use a VqMod, to scan the entire >?.php< Files in the catalog-Sub of a shop, just to 'find' the content in possibly two different places only, in my Case, in:
C:\JTI_Servers\bigmax.ch\shop\catalog\model\tool\image.php
C:\JTI_Servers\bigmax.ch\shop\catalog\model\openbay\ebay_product.php
but this is my personal Opinion only!

no offense!!
Ernie