Well, i am trying to make 2 stores. i am going to do them with different themes, so i have created 2 opencart foldera:
i have created
../publick_html/myopencartsite
i installed opencart here
and when i have copyed everything from myopencartsite
../publick_html/myopencartsite/foto
creating new store in admin pannel and putting in store url ../publick_html/myopencartsite/foto/
So well, in my secondstore all the image link have http://.../foto/image/...
I dont really understand why. Can somebady explain it??
in my config i have define('DIR_IMAGE', '/home/u609004411/public_html/image/');
and not ('DIR_IMAGE', '/home/u609004411/public_html/foto/image/');
So why it is changing??
i have created
../publick_html/myopencartsite
i installed opencart here
and when i have copyed everything from myopencartsite
../publick_html/myopencartsite/foto
creating new store in admin pannel and putting in store url ../publick_html/myopencartsite/foto/
So well, in my secondstore all the image link have http://.../foto/image/...
I dont really understand why. Can somebady explain it??
in my config i have define('DIR_IMAGE', '/home/u609004411/public_html/image/');
and not ('DIR_IMAGE', '/home/u609004411/public_html/foto/image/');
So why it is changing??
Code: Select all
creating new store in admin pannel and putting in store url ../publick_html/myopencartsite/foto/
Code: Select all
So well, in my secondstore all the image link have http://.../ foto/image/...
I dont really understand why. Can somebady explain it??
When you specify DIR_IMAGE in your config it is for the Opencart to know what folder to put the images to using php.
But the DIR_IMAGE cannot be used for URLs in browsers.
In older versions of opencart there was HTTP_IMAGE setting in config.php just for such situations. But it is no longer.
Well, but in my model/image.php it is using like link "DIR_IMAGE . reltive_url_fro_DB" so is should give in the brauser full link without foto?? Or i dont know something about image getting mecanism??deepvision wrote:This is not a valid store URL to putCode: Select all
creating new store in admin pannel and putting in store url ../publick_html/myopencartsite/foto/
Because you have put your site under a foto folder. Site URLs and SRC attributes for images in browsers are relative to your site folder.Code: Select all
So well, in my secondstore all the image link have http://.../ foto/image/... I dont really understand why. Can somebady explain it??
When you specify DIR_IMAGE in your config it is for the Opencart to know what folder to put the images to using php.
But the DIR_IMAGE cannot be used for URLs in browsers.
In older versions of opencart there was HTTP_IMAGE setting in config.php just for such situations. But it is no longer.
I don't know what model/image.php you refer to but it uses DIR_IMAGE only to be able to get images and process them. DIR_IMAGE has nothing to do with how the final URL should look like.
What you need can be probably achieved with some extension.
Update: Also you can modify the code of your theme (in view folder) and add ../ to images src attributes.
What you need can be probably achieved with some extension.
Update: Also you can modify the code of your theme (in view folder) and add ../ to images src attributes.
Last edited by deepvision on Thu Jun 25, 2015 6:58 pm, edited 1 time in total.
deepvision wrote:I don't know what model/image.php you refer to but it uses DIR_IMAGE only to be able to get images and process them. DIR_IMAGE has nothing to do with how the final URL should look like.
What you need can be probably achieved with some extension.
Update: Also you can modify the code of your theme (in view folder) and add ../ to images src attributes.
Well, in opencart DB image link is saved like relative url.
When you are trying to get image url, for rist you are going to model/product, so you have relative url, when you are looking in your brauser you have full url, not realative, so where relative url is converted in full url??
catalog/model/tool/image.php:
which you should probably replace to
admin/model/tool/image.php:
which you should probably replace to
Code: Select all
return $this->config->get('config_url') . 'image/' . $new_image;
Code: Select all
return '/image/' . $new_image;
Code: Select all
return HTTP_CATALOG . 'image/' . $new_image;
Code: Select all
return '/image/' . $new_image;
Well thank youdeepvision wrote:catalog/model/tool/image.php:which you should probably replace toCode: Select all
return $this->config->get('config_url') . 'image/' . $new_image;
admin/model/tool/image.php:Code: Select all
return '/image/' . $new_image;
which you should probably replace toCode: Select all
return HTTP_CATALOG . 'image/' . $new_image;
Code: Select all
return '/image/' . $new_image;
it was
return MydefoultStore . '/image/' . $new_image;
Who is online
Users browsing this forum: No registered users and 4 guests