Post by ab-oc » Fri Apr 14, 2017 2:46 am

Hello everybody,

I'm using OC 1.5.6.4.
Installed in www.mydomain.com/subdomain/

When I use relative path for images in product-description or information-description etc. the images arn't displayed.

Full image path is: http://www.mydomain.com/subdomain/image/data/picture.jpg
Relative path is: /image/data/picture.jpg
OC completes the relative path to: http://www.mydomain.com/image/data/picture.jpg

As you can se the subdomain is missing in completed path.
Where I have to mod the source code to add the subdomain?

Thank you very much for tips and hints ;D

Andreas
Last edited by ab-oc on Fri Apr 14, 2017 6:00 am, edited 1 time in total.

New member

Posts

Joined
Tue Apr 29, 2014 11:22 pm

Post by IP_CAM » Fri Apr 14, 2017 4:24 am

why not move on to simple Subdomain Images, then, it's a LINK, and no longer an internal Path,
and it will greatly improve Site test Results as well! It's used in all of my test shops. And if
you use http://site, instead of http://www.site, just change the HTTP/S_IMAGE links in the
both config.php files accordingly, it's now set to address the SHOP with http://www.site.
Good Luck ;)
Ernie
---
CONFIG.PHP File CHANGE (admin + root section)

Code: Select all

// HTTP
define('HTTP_SERVER', 'http://www.bigmax.ch/subdomain/shop/');
define('HTTP_IMAGE', 'http://bigmax.ch/subdomain/shop/image/');
// HTTPS
define('HTTPS_SERVER', 'http://www.bigmax.ch/subdomain/shop/');
define('HTTPS_IMAGE', 'http://bigmax.ch/subdomain/shop/image/');
restore_http_image_plus_size.xml should work with and without HTTP/S,
and it add's the decade-long missing OC Image Size Tags to the Pic's as well.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[HTTP_IMAGE + HTTPS_IMAGE Links and Sizes]]></id>
<version><![CDATA[OS v.1.5.6.x]]></version>
<vqmver><![CDATA[2.4.1]]></vqmver>
<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>
<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>
</operation>                  
</file>

<file name="admin/model/tool/image.php">
<operation error="skip">
<search position="replace"><![CDATA[return HTTPS_CATALOG . 'image/' . $new_image;]]></search>
<add><![CDATA[return HTTPS_IMAGE . $new_image . '" width="' . $width . '" height="' . $height;]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[return HTTP_CATALOG . 'image/' . $new_image;]]></search>
<add><![CDATA[return HTTP_IMAGE . $new_image . '" width="' . $width . '" height="' . $height;]]></add>
</operation>                  
</file>

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

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by ab-oc » Fri Apr 14, 2017 5:59 am

IP_CAM wrote:
Fri Apr 14, 2017 4:24 am
why not move on to simple Subdomain Images, then, it's a LINK, and no longer an internal Path,
and it will greatly improve Site test Results as well! It's used in all of my test shops. And if
you use http://site, instead of http://www.site, just change the HTTP/S_IMAGE links in the
both config.php files accordingly, it's now set to address the SHOP with http://www.site.
Good Luck ;)
Ernie
Hello Ernie, not really what I asked for ;)

Found issue after some time of digging around:
I set the relative path with beginning slash: /image/data/picture.jpg --> isn't working.
The right relative path is without beginning slash: image/data/picture.jpg --> is working ;D

Thank you...

New member

Posts

Joined
Tue Apr 29, 2014 11:22 pm

Post by IP_CAM » Fri Apr 14, 2017 7:01 am

I am aware of this, but you will be happy, after testing your Site on GTMetrix, to have it included.
Good Luck
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Users browsing this forum: No registered users and 47 guests