Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / how to properly override the function?

how to properly override the function?

Views: 437

Results 1 to 5 of 5
21 Apr 2011, 10:46 PM
#1
feelexit avatar

feelexit

New Zenner

Join Date:
Nov 2004
Posts:
2
Plugin Contributions:
0

how to properly override the function?

I am working on my first theme. in the tpl_product_info_display.php page, it uses " zen_get_products_display_price((int)$_GET['products_id'])" to display the price.
this function added "<br/>" tag
$35.99 $30.00
Save: 17% off

I want this to be one line. ($35.99 $30.00, Save: 17% off).

I try to add "my-style" folder to "includes/functions", then override the function. but its not working. I prefer not to change the function file directly, please show me the proper way to modify the functions.

22 Apr 2011, 12:02 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: how to properly override the function?

Due to the way functions work, there are no overrides for function files.

17 Jun 2012, 6:57 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: how to properly override the function?

FWIW, I've used that function-override method for a couple of years now. You just have to be aware that your 'override' function files will still override (sometimes when they don't want to) on any Zen-Cart version updates you might apply to your installation, but it does serve to highlight which function-related files you've modified.

17 Jun 2012, 7:20 PM
#5
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: how to properly override the function?

Good, thank you.