Zen Cart Logo

How to merge files

Locked

Views: 2,367

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
6 Dec 2006, 10:28 PM
#1
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

How to merge files

I hope I'm posting this in the right spot.

I've installed a few modules for my ZenCart. Some of them require "overwriting or merging" files such as includes/fundtion/html_output.php. Am I figuing right that merging is the better way to go so that I don't lose necessary info for previously installed mods?

But HOW do I do it?? I installed WinMerge, and it showed me where all the differences are, but do I simply use the copy to right feature? (Assuming the newest file is on the left.) Will that "merge" the files with out messing up the code?

I don't know ANYTHING about php (well, perhaps I am starting to a* very* little bit...) and I'm a nervous wreck that I'm gonna mess something up. I am backing up all origonal stuff and using the over-ride system very carefully....

Thanks for your help!

~Allison

7 Dec 2006, 10:16 PM
#2
phid avatar

phid

Totally Zenned

Join Date:
Nov 2005
Location:
Narnia
Posts:
696
Plugin Contributions:
0

Re: How to merge files

Allison,

What files or contribution are you looking to merge?

Usually merging is just taking the changes from one file and inserting them into another file in the appropriate space. I try to avoid merging when I can, though obviously sometimes it's needed.

7 Dec 2006, 10:39 PM
#3
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: How to merge files

I am in the middle of figuring it out now... I added the blank side box, column layout grid, and css flyout category (are they called?) modules. None of them gave me any trouble or required that I overwrite files.

Yesterday I started adding Image Handler. I had to stop dead in my tracks until I got this thing figured out. I don't want to mess something up just becuase of lack of knowlege...

So, I am creating a log of everything I did (it was all in my mind until I started seeing that recommended on the forum). I am just about finished with it.

For now, I know of several that are being contradicted I just don't know if they are original ZenCart files or one of the contributions.

admin/includes/modules/category_procut_listing.php
includes/function/html_output.php
includes/modules/additional_images.php
includes/modules/main_product_image.php
includes/modules/pages/popup_images/header_php.php
includes/modules/pages/popup_image_additional/header_php.php

Anyway - I didn't post this in the Image Handler thread because I kind of figured it would possibly apply to any add-on I might use in the future. Is it very hard to figure out where these "appropriate spaces" are to insert the changes? I might not know anything about PHP, but I've got enough determination that I'd like to get this figured out.... Uh... with help of course! 8)

Thanks SO much for your help!
~Allison

7 Dec 2006, 11:22 PM
#4
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: How to merge files

OK - just finished the log. All the files in question were original files as far as I can tell. So - do I just over-write them or merge them? I'd like to do what is best - even if it means "not the easiest".... I wish I knew how to merge.... I guess it's my newest learning curve....

9 Dec 2006, 7:23 AM
#5
phid avatar

phid

Totally Zenned

Join Date:
Nov 2005
Location:
Narnia
Posts:
696
Plugin Contributions:
0

Re: How to merge files

I don't know enough about the IH files to let you know for sure, but I can say that it's a good idea to save a copy of the original file on the side so if the merged file is bad you can simply upload the original. IH essentially broke part of my cart when I installed it once because of what I think was a conflict with another mod, but I believe that's been worked out since. I think that IH is kind of in its own category in terms of how to get it to work.

For the most part, though, you don't need to merge files when you install contributions. Most of the time you'll simply use the override system so you don't have to merge. Makes things so much easier!

9 Dec 2006, 4:34 PM
#6
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: How to merge files

Thanks for your help. Maybe I should try asking over in the IH thread.... I thought IH would save me some time, but maybe I should just stick with Photoshop and edit my own images! :)

Glad to know most other mods don't make me merge files! Thankfully, I did make copies of the files that will be merged. I guess it won't hurt to experiment if I carefully backup what is working first!

Have a great day!
Allison

9 Dec 2006, 5:06 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to merge files

There is not a one answer fits all for this...I will attempt to describe it in the best way I can through example.
Looking at this file and what you have determined so far:
includes/modules/additional_images.php and this is an original file:
Assuming that you are using the override template system you have:

includes/modules/additional_images.php
includes/modules/your_template/additional_images.php

Let's assume that you are currently using Zen Cart v1.3.5 and looking to upgrade to v1.3.6. so first thing to do for this file is to inspect the original file in 1.3.5 to the original file in 1.3.6.

See if there are code differences and note what they are (date & other differences that are commented out are not important)

Then compare the 1.3.5 original file to the modified file for what code differences there are..

Now if you found differences between the 1.3.5 and 1.3.6 files, you then need to attempt to incorporate these differences into the modified file to bring it up to date.

Always make a backup first, and check your modified files for function and if this has caused problems you can easily back out the changed file and seek assistance.

For files that are not overrideable I suggest that you rename the original file from for instance: admin/includes/modules/category_product_listing.php
to: admin/includes/modules/category_product_listing.orig
In this way you will always know prior to an upgrade the files that have been changed and the one that you have to check.

I know this is breif, but I hope that it points out the basics.

9 Dec 2006, 5:46 PM
#8
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: How to merge files

Thank you SO much for your help! I want so bad to get this learned!

kobra:

you have determined so far:
includes/modules/additional_images.php and this is an original file:
Assuming that you are using the override template system you have:

includes/modules/additional_images.php
includes/modules/your_template/additional_images.php

Let's assume that you are currently using Zen Cart v1.3.5 and looking to upgrade to v1.3.6. so first thing to do for this file is to inspect the original file in 1.3.5 to the original file in 1.3.6.

Actually, I have a fresh v1.3.6 install. (I'm a happy new ZenCart user for 2 weeks now.) I thought the override overide system was only for where there is a 'classic' folder. AND - in another thread someone said:

Theory says you should be able to override /includes/modules by using /includes/modules/YOUR_TEMPLATE.

But that does not always work. So for IH2 Final I suggest overwriting files....

But if you say it works, I'd rather use the override system.

check your modified files for function and if this has caused problems you can easily back out the changed file and seek assistance.
I'll try.... Slowly and carefully....

For files that are not overrideable I suggest that you rename the original file from for instance: admin/includes/modules/category_product_listing.php
to: admin/includes/modules/category_product_listing.orig
In this way you will always know prior to an upgrade the files that have been changed and the one that you have to check.

I will follow your suggestion. Thankfully, that particular file mentioned was identical. However, includes/functions/html_output.php had tons of differences. The other thread I mentioned earlier said that there was no overide for includes/functions. Is that right? I only want to merge if I have to...

Thanks again for your help!
~Allison

9 Dec 2006, 7:22 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to merge files

/includes/modules :: has a classic folder and can be overridden with /includes/modules/tour_template for the files that are under modules but not the folders...you have to look inside the folder and see if there is a "classic" indis of it.

/includes/functions does not have a "classic" and therefore no override. try the rename of the original and replace with your edited file.

Asl, if you are not upgrading, just try the module files as they are as many are already updated for 1.3.6 or have been tested and are known to work as is.