Post by geotnt » Wed Jan 27, 2016 7:01 am

I'm in the process of upgrading my wife's site from zencart to opencart 2.0. To allow her zencart site to work while she's uploading products to the opencart site, I installed OC into a "development" directory -- ie. http://www.hersite.com/development

As I've been reviewing what she's gotten done so far, I notice that all the image links are absolute: www.hersite.com/development/image...

Is there anyway to change OC so the links are relative? So that when I copy her site to the root directory all the links won't have to be redone?

When I do move the files to the root directory, what files need to be edited. Tell it to me like I'm a newby.

Thanks.

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by Randem » Wed Jan 27, 2016 8:58 am

Hi geotnt,

I don't quite understand...
Set the path in the config.php files (root and admin) the path is absolute. If you point it to where the images are then that is where they will be gotten from. Reminder the correct path for the images is image/catalog so in the config.php files for the images

define('DIR_IMAGE', '/home/content/57/10005557/html/opencarttest/image/');

OpenCart adds catalog to the defined path.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by geotnt » Thu Jan 28, 2016 7:32 am

Randem, thanks for replying. Let me try to explain better.

Currently, she has a zencart site running at www.hersite.com (not the actual domain name)

To test and subsequently build her opencart site, opencart was installed at www.hersite.com/development

As she has been building her site, I've gone back and if I "view source" for one of her product pages, I see <img src="http://hersite/development/image/cache/ ... gename.jpg"

Once I move all her files from the "development" subdirectory, to the root directory, none of these image links will work, as the photos will actually be at <img src="http://hersite/image/cache/catalog/Iren ... gename.jpg"

One should be able to set opencart so that when building out a store, relative links are used. In this case <img src="/image/cache/catalog/Irene/images/imagename.jpg"

For the second part, is there a step by step that tells how to move from a subdirectory to a root directory and then what exactly needs to be edited in the .php files? Guess I don't really understand what the php files actually do - I haven't even looked at them to this point.

Thanks in advance

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by Randem » Thu Jan 28, 2016 7:49 am

The only php file you need to edit is the config.php files to point to the new location. OpenCart has a fixed internal structure for the images in the catalog and cache/catalog folders. This is hard coded but is used with the
define('DIR_IMAGE', '/home/content/xx/1000xxxx/html/opencarttest/image/'); parameter

It will become DIR_IMAGE . catalog and DIR_IMAGE . cache/catalog so if you change the DIR_IMAGE to the root of define('DIR_IMAGE', '/home/content/xx/1000xxxx/html/image/'); it will do as you want, but the hard code structur will remain the same.

The html pages are generated on the fly so relative paths are not needed...

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by geotnt » Fri Jan 29, 2016 7:20 am

Alright then. Thanks.

So, to move the store from the subdirectory to the root folder, is it as simple as dragging and dropping all the files from one to the other, since it's still on the same domain?

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by Randem » Fri Jan 29, 2016 7:31 am

And changing the config.php files to point to the new location...

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by IP_CAM » Fri Jan 29, 2016 10:40 am

just don't forget, to modify the .htaccess file accordingly as well, or it won't work!
Sample: Destination site-url/shop/index.php...

Code: Select all

# SEO URL Settings
RewriteEngine On
RewriteBase /shop/
And make sure, by checking into a Backup Copy of your DB, that you had no MOD installed,
adding some DIRECT LINKS to the DB (Shop-SUB), where the old Shop has been before.

Code: Select all

INSERT INTO `oc_blog_description` 
................ src="http://images.openshop.li/shop/image/data/vqmod-570x333.jpg" width="499" /></p>\r\n<p>\r\n .....

Code: Select all

INSERT INTO `oc_order` (`order_id`, `invoice_no`, `invoice_prefix`, `store_id.......... (24, 0, 'INV-2015-00', 0, 'Ernie''s OpenShop', 'http://www.hitline.info/shop/', 2, 3, 'Hans', 'Meier', 'jti@jacob.ch', '
e.t.c. ;D
I would THEREFORE clean out a DB first, of such Data !

Good Luck ! ;)
Ernie
openshop.li

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'200+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Post by gogoweb » Sat Jan 30, 2016 12:19 pm

geotnt wrote:Alright then. Thanks.

So, to move the store from the subdirectory to the root folder, is it as simple as dragging and dropping all the files from one to the other, since it's still on the same domain?
In opnecart links are relative by default. As others said you just need to properly adjust config.php / .htaccess after yuo copy / move the files.

All mods | OpenCart Bulk Related Products Ultimate Edition |GeoIP hide Prices / no add to cart by country| CSS override | Direct link to checkout / skip add to cart / buy now link | AUTO pilot - reward & purchase points


New member

Posts

Joined
Sat Oct 18, 2014 6:45 pm


Post by geotnt » Mon Feb 01, 2016 6:43 am

So, the config.php files have about a dozen or so lines. I just edit each of those lines to indicate the correct path and I'm done.

Except for the htaccess file. Where is it located? And, I'm still fuzzy on the details of what needs to be edited therein.

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by geotnt » Mon Jun 13, 2016 1:13 am

Who has done this that can give me a step by step? Please?

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by Randem » Mon Jun 13, 2016 2:56 am

1 - Move the store structure to where you want it to be
2 - Run repair_settings.php and select all the recommended paths
3 - Run your new store...
Last edited by Randem on Thu Jun 23, 2016 6:27 am, edited 1 time in total.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by geotnt » Sun Jun 19, 2016 11:50 pm

Can someone tell me if this will work?

My wife currently has a web domain, www.herdomain.com
Her host allows multiple addon domains, so she also has www.addondomain.com which is a subdomain located under public/html

We've developed her new site as a subdomain, currently at www.herdomain.com/development

Will it work if I change the directory name for subdomain to subdomain2 and then rename development to subdomain?

It seems like it should, but I'm unsure and help would be appreciated.

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by Burt65 » Mon Jun 20, 2016 9:26 am

geotnt wrote:Can someone tell me if this will work?

My wife currently has a web domain, http://www.herdomain.com
Her host allows multiple addon domains, so she also has http://www.addondomain.com which is a subdomain located under public/html

We've developed her new site as a subdomain, currently at http://www.herdomain.com/development

Will it work if I change the directory name for subdomain to subdomain2 and then rename development to subdomain?

It seems like it should, but I'm unsure and help would be appreciated.

You have a beautiful wife..
herdomain.JPG

herdomain.JPG (48.71 KiB) Viewed 4192 times


Now regarding your question, I think you should follow the instructions given to you in all the above posts, and if you want to try to just rename the directory instead, be my guest. If it works, great...

Over 95% of all computer problems can be traced back to the interface between the keyboard and the chair...


User avatar
Active Member

Posts

Joined
Mon Nov 18, 2013 3:23 pm
Location - Oz

Post by D_comp » Mon Jun 20, 2016 8:19 pm

geotnt wrote:Randem, thanks for replying. Let me try to explain better.

Currently, she has a zencart site running at http://www.hersite.com (not the actual domain name)

To test and subsequently build her opencart site, opencart was installed at http://www.hersite.com/development

As she has been building her site, I've gone back and if I "view source" for one of her product pages, I see <img src="http://hersite/development/image/cache/ ... gename.jpg"

Once I move all her files from the "development" subdirectory, to the root directory, none of these image links will work, as the photos will actually be at <img src="http://hersite/image/cache/catalog/Iren ... gename.jpg"

One should be able to set opencart so that when building out a store, relative links are used. In this case <img src="/image/cache/catalog/Irene/images/imagename.jpg"

For the second part, is there a step by step that tells how to move from a subdirectory to a root directory and then what exactly needs to be edited in the .php files? Guess I don't really understand what the php files actually do - I haven't even looked at them to this point.

Thanks in advance
first, you wanted to try Opencart installed in a sub_dir (called "development")
then, now You want to move all source to webroot ?
as my point, you shoulde edit the config files, example like this:
// HTTP
define('HTTP_SERVER', 'http://domain/development/');

// HTTPS
define('HTTPS_SERVER', 'http://domain/development/');

// DIR
define('DIR_APPLICATION', '/home/user/public_html/development/catalog/');
define('DIR_SYSTEM', '/home/user/public_html/development/system/');
define('DIR_IMAGE', '/home/user/public_html/development/image/');
define('DIR_LANGUAGE', '/home/user/public_html/development/catalog/language/');
define('DIR_TEMPLATE', '/home/user/public_html/development/catalog/view/theme/');
define('DIR_CONFIG', '/home/user/public_html/development/system/config/');
define('DIR_CACHE', '/home/user/public_html/development/system/storage/cache/');
define('DIR_DOWNLOAD', '/home/user/public_html/development/system/storage/download/');
define('DIR_LOGS', '/home/user/public_html/development/system/storage/logs/');
define('DIR_MODIFICATION', '/home/user/public_html/development/system/storage/modification/');
define('DIR_UPLOAD', '/home/user/public_html/development/system/storage/upload/');
remove the sub_fir in each line

Guide making websites


Newbie

Posts

Joined
Tue Jun 14, 2016 8:06 pm

Post by Randem » Tue Jun 21, 2016 11:40 am

Hi D_comp,

I did give you the simplest way to achieve what you want to do. Try it before complicating the issue...
Put the file in the root of the new folder where you copied the OpenCart software to then run the repair_settings.php script, take all the defaults and recommendations and you should be all done.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by geotnt » Wed Jun 22, 2016 8:28 am

Can anyone else speak to the repair_settings.php script? Has anyone else used it? Is it possible malware?

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by Randem » Wed Jun 22, 2016 9:37 am

You win... I give up ???

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by geotnt » Thu Jun 23, 2016 5:50 am

Randem wrote:You win... I give up ???
Why? I don't know you and I'm leery of running scripts on my machines so I was asking if anyone could vouch for it.

I asked a simple question about renaming the directories and you want me to run a javascript on your say-so? That's not good computer security by any stretch.

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by Randem » Thu Jun 23, 2016 6:04 am

All you had to do was read the information in the link... ???

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by geotnt » Thu Jun 23, 2016 6:14 am

Sorry for being overly cautious. Everything in the link sounds good and simple, but there is still no info on where the script comes from, who has tried it, if it's good or bad - nothing.

Again, I'll ask the question: Is there any reason why I can't just rename the directories, edit the config files and be done with it? Seems to me that would be much easier than this. But, if it won't work, that's a whole other story.

Thanks for being patient.

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm
Who is online

Users browsing this forum: No registered users and 12 guests