Jump to content

imnik
 Share

Recommended Posts

Hello,

 

Please help me out with a proper way to override AdminProductsController. What I tried is this, I made little changes to  AdminProductsController.php i.e as

 

public function __construct(){

....

// my editing

echo "hello";

echo "<script>alert('wait here')</script>";

...

}

Now i kept this in

 

C:\xampp\htdocs\prestashop\modules\mymodule\override\controllers\admin\AdminProductsController.php

 

Inside this file have extended like this:

 

class AdminProductsController extends AdminProductsControllerCore

{

...

}

Attached herewith the sample file for better understanding,please try and response back.

 

The same works in prestashop 1.6.0.9

 

Thanks in Advance.

 

AdminProductsController.php

  • Like 2

Share this post


Link to post
Share on other sites

For Bellini,

 

First of all it is hard to find on modules menu itself.

And once when i got it was giving overriding error and before installling i have deleted it from override folder too..

 

For coeos.pro

Yes i delete the cache folder itself and tried too

Share this post


Link to post
Share on other sites

Hey Bellini,

 

Once when it got installed threw Bad Sql Error and this time it was overrided.

However, later it is not getting install and throwing installation error.

 

Attached screenshots for ur reference.

post-943927-0-26220500-1425464140_thumb.pngpost-943927-0-06432000-1425464149_thumb.png

Edited by imnik (see edit history)

Share this post


Link to post
Share on other sites

well, in the first error it is telling you that your SQL statement is invalid.  Since you did not provide the code as I asked previously, I cannot help you.

 

in the second error, it is saying the override of the AdminProductionsController from the marketplace module is failing.  this is a known issue and is caused by comments in the override file (comments using //).  remove the comments from the override and try again.

Share this post


Link to post
Share on other sites

Hey Bellini,

 

I will upload once again, Just have a look , where my piece of code is only this

 

echo "marketplace"; 

This prints marketplace, however the BAD SQL error appears when AdminProductsController is called.

 

Prestashop itself has commented like this and validator says the same i guess.. Below are some their commented lines

// @since 1.5 : translations for tabs

// convert price with the currency from context

// @todo : move in processEditProductImage

and more.

 

I have added AdminProductsController which goes to override/controllers/admin/ folder after installation of module.

 

Suggestions are Welcomed.

 

Thanks in Advance.

post-943927-0-14732500-1425534449_thumb.png

AdminProductsController.php

Share this post


Link to post
Share on other sites

@Foovince

 

I need to filter products according to seller, so i am using many functions..

Now the problem is that it throws Bad Sql Error when AdminProductsController is called on backend and that part i havn't made any changes so what i need to do.

 

@EL Patron

 

Sorry newbie so don't have much idea. Next Time will keep this in record :)

Share this post


Link to post
Share on other sites

Thank You,

 

I tried using

AdminController::

 

instead of parent::

so it was silly mistake as i am newbie.

 

However i am getting stuck in AdminOrdersController now. I have overrided this file too. For better understanding i have uploaded the AdminOrdersController.php and Order.php in which i made changes please give suggestion for this as it gets blank

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