Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 649 Vote(s) - 3.45 Average
  • 1
  • 2
  • 3
  • 4
  • 5
prestashop 1.5 core file overwrite

#1
I want to overwrite prestashop 1.5 core file `FrontController.php` to overwrite from `override\classes\controller` folder but it didn't load my overwrite folder file.


<?php

class FrontController extends FrontControllerCore
{

/* Display a specific page if the user country is not allowed */
protected function displayRestrictedCountryPage() {

}
}


Any body have idea how to over write core prestashop file in 1.5

I also follow this [document][1] but no way to solve.


[1]:

[To see links please register here]

Reply

#2
Prestashop 1.5.x automatically merge default override file and you custom file on `module::install()` function. You just need to create a correct hierarchy in your module folder: `modules/your_package/override/classes/controller/FrontController.php` with your custom functional.
If you don't have an extension and want to add override manually - you need to change the file `override/classes/controller/FrontController.php`
Reply

#3
After override whatever you want don"t forget to delete the cache folder contents and recreate them because that lost my time for a while till found the solution [here][1]


[1]:

[To see links please register here]

Reply

#4

Just remove the **class_index.php** under */cache* folder.

It carries Presta's Class & Controller file details. Once you delete and reload the page, prestashop will automatically generate the file with latest changes.
Reply

#5
The problem may be, that one of your functions which contains `parent::nameOfFunction`, You should replace parent in the function by the inheritance of the parent function you want to override.
Reply

#6
The function you're trying to override is called in the core function init(). what you should do is to override both init() and displayRestrictedCountryPage(). Then inside the init function use Controller::init() instead of parent::init()
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through