Zen Cart Logo
Forums / Code Collaboration / Custom Functions

Custom Functions

Views: 2,087

Results 1 to 3 of 3
25 Feb 2013, 12:36 PM
#1
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Custom Functions

I'm working at a responsive template based on Zurb Foundation and I have some custom functions . In practice I have to create my own zen_draw_form() function and others but I don't want to make changes on /include/functions/html_output.php file cause I don't like the idea to change core files .
I ask you where is better to place my custom functions files ( used only for new template ) in order to keep clean the core files .

THANK YOU

25 Feb 2013, 1:26 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Custom Functions

Functions can't be overwridden, which means that there are a very limited number of places whereby you can define your own without causing a conflict. I see no reason why you can't define your custom function(s) within the template file itself. If you prefer to store them in a more 'global' location you'll need to take steps avoid any conflict with the original functions.. The easiest way to do this is to call your functions by a slightly different name than the originals. Your newly created functions can then simply be placed in a file in your /includes/functions/extra_functions/ folder.

Cheers
Rod

25 Feb 2013, 1:50 PM
#3
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Custom Functions

Sorry Rod , but my english is a mess ..
I did not plan to overwrite functions but to create new functions ( different names ) without modify core files . You gave me the solution by placing my custom file inside /includes/functions/extra_functions/ .

Thank you