Jump to content

imnik

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
Link to comment
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

Link to comment
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.

Link to comment
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

Link to comment
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 :)

Link to comment
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

Link to comment
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
×
×
  • Create New...