Jump to content

[solved] Overrider class by module


tabutnas
 Share

Recommended Posts

thanks i do it and works well , but i have some questions;

 

why i need file index.php on all dirs?

example

modules/overriderTest/override/controllers/index.php

modules/overriderTest/override/controllers/front/index.php

modules/overriderTest/override/controllers/front/OrderController.php

index.php -> content

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");

header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

header("Location: ../");
exit;

 

And i can overrider .tpl files of theme/default?

 

thanks in advance

Edited by tabutnas (see edit history)

Share this post


Link to post
Share on other sites

It's for security reason, when someone manually go to URI like

http:// domain/modules/overriderTest/override/controllers/front/

index.php file will redirect him one folder back and again and again and again so that person dont see files on server but will be redirected to Home page

That part will do that:

header("Location: ../");

 

If you want to edit Default theme the best way is to create new one from default files. Go to BackOffice -> Preferences -> Themes -> Add New and check Copy files from default theme. Then set Your new theme as active.

Edited by Piotr Kaczor (see edit history)
  • Like 2

Share this post


Link to post
Share on other sites

i do it replacing $this->setTemplate(_PS_THEME_DIR_.'authentication.tpl'); for $this->setTemplate($_SERVER['DOCUMENT_ROOT'].__PS_BASE_URI__.'modules/module_test/template/authentication.tpl'); .

 

My modification AuthController.php copy well on overrider/controller/front/... But prestashop not use my authController.php modification, prestashop use original AuthController.php :S. What i can do for prestashop use Authcontroller.php of dir /override/ ???

 

Code of override --> log.belvg.com/how-to-make-an-override-in-your-module.html

 

thanks in advance

Share this post


Link to post
Share on other sites

hello

 

instructions here:

 

Furthermore if you are the author of the topic for which a solution has been found, please edit your topic title to mark it as [sOLVED].

 

To mark a topic as [solved] :

- Edit the first post of your topic by clicking on the "Edit" button,

- Click on the "Use full editor" button,

 

- Add the "[solved]" string at the beginning of your topic title and click on the "Submit Modified Post" button.

 

 

i'm going to mark this thread as [solved] but if you will follow these steps in the future - we will be really grateful :)

 

regards

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More