Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Php Fatal Error: Cannot Redeclare _Fn_Get_Orders_Taxes_Subtotal() Rate Topic   - - - - -

 
  • Jamalla
  • Advanced Member
  • Members
  • Join Date: 23-Sep 17
  • 145 posts

Posted 03 May 2018 - 09:00 AM #1

Hi,

We are using "MV 4.7.3"; When vendor tries to add "Option Combinations" he gets the following error.
Any Help please?

PHP Fatal error: Cannot redeclare _fn_get_orders_taxes_subtotal() (previously declared in xxxx/public_html/app/functions/fn.control.php(697) : eval()'d code:329) in xxxx/public_html/app/functions/fn.control.php(697) : eval()'d code on line 358

 

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17833 posts

Posted 03 May 2018 - 12:17 PM #2

Looks like someone modified core files. fn.control.php file does not contain such a function out of the box


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Jamalla
  • Advanced Member
  • Members
  • Join Date: 23-Sep 17
  • 145 posts

Posted 03 May 2018 - 03:00 PM #3

Looks like someone modified core files. fn.control.php file does not contain such a function out of the box

 

Thanks eComLab for the reply ..

 

I have checked the "File Change Detector" in no such file has been changed .. I am not sure but we have updated the cs-cart couple days ago ..



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 03 May 2018 - 05:56 PM #4

Note that there is no function named "_fn_get_orders_taxes_subtotal" in standard cs-cart but there is a "fn_get_orders_taxes_subtotal" declared within the backend/index.php controller  It is used for calculating statistic info on the admin home page.  If you're getting a "re-declaration" then something is loading fn_control.php twice and I can assure you it is not standard cs-cart code.  

 

So my guess is that someone added that function to fn.control.php (not the right place either) and changed the name by adding an underscore to the name.  They are then using it as a variable modifier in a smarty template.  There are several things wrong with this approach.  Suggest you either contact your developer who made the changes and have them correct it or work with a developer who is more familiar with cs-cart and will utilize best-practices so that upgrading will not impact your customizations.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17833 posts

Posted 04 May 2018 - 06:21 AM #5

Thanks eComLab for the reply ..

 

I have checked the "File Change Detector" in no such file has been changed .. I am not sure but we have updated the cs-cart couple days ago ..

 

Download distributive from CS-Cart website and compare fn.control.php files. I am sure that the files will be different

 

Anyway, you should address this issue to your developer


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Jamalla
  • Advanced Member
  • Members
  • Join Date: 23-Sep 17
  • 145 posts

Posted 04 May 2018 - 07:53 AM #6

Many thanks Tony and eComLab for your kind support.

 

@Tony:

 

Note that there is no function named "_fn_get_orders_taxes_subtotal" in standard cs-cart but there is a "fn_get_orders_taxes_subtotal" declared within the backend/index.php controller  It is used for calculating statistic info on the admin home page.  If you're getting a "re-declaration" then something is loading fn_control.php twice and I can assure you it is not standard cs-cart code.  

 

So my guess is that someone added that function to fn.control.php (not the right place either) and changed the name by adding an underscore to the name.  They are then using it as a variable modifier in a smarty template.  There are several things wrong with this approach.  Suggest you either contact your developer who made the changes and have them correct it or work with a developer who is more familiar with cs-cart and will utilize best-practices so that upgrading will not impact your customizations.

 

I tried to track the issue; I searched for both (fn_get_orders_taxes_subtotal) and (_fn_get_orders_taxes_subtotal) in (fn_control.php) but I could not find any of them .. and I am not sure why fn_control.php is called ..

We do not give any access to our live website for any developer and we do all of the changes in a test website .. The only new thing we did recently is updating the CS-Cart ..

 

 

Download distributive from CS-Cart website and compare fn.control.php files. I am sure that the files will be different

 

Anyway, you should address this issue to your developer

 

Thanks for the advise; I did what you advised and the I only found ONE difference:

F1GLzTn.png



 
  • Jamalla
  • Advanced Member
  • Members
  • Join Date: 23-Sep 17
  • 145 posts

Posted 04 May 2018 - 07:58 AM #7

And the strange point here is that the error happen only with vendors when they try to add "Option Combination"




 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17833 posts

Posted 04 May 2018 - 01:17 PM #8

Try to find fn_run_controller function in the app/functions/fn.control.php file and add 

fn_print_r($check_included, $path);

after

$code = fn_get_contents($path);

Then reproduce the error and provide us with the debug information

 

Looks like some controller is called 3 times


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Jamalla
  • Advanced Member
  • Members
  • Join Date: 23-Sep 17
  • 145 posts

Posted 04 May 2018 - 01:31 PM #9

Try to find fn_run_controller function in the app/functions/fn.control.php file and add 

fn_print_r($check_included, $path);

after

$code = fn_get_contents($path);

Then reproduce the error and provide us with the debug information

 

Looks like some controller is called 3 times

 

Many thanks .. I will do that and revert to you ..