Jump to content

overriding back office tabs causes problem with ajax


Recommended Posts

Hello everyone,

I've followed the information on this site: http://www.nethercottconstructions.com/en/content/55-overriding-back-office-tabs to override a back office tab.

I did exactly the same thing as in the instructions on that site; I also needed to override AdminProducts.php

I need to do this because I want to have some extra functionality implemented under the Combinations tab ( Catalag > choose a product > Combinations )

and then I noticed that the AdminProducts.php that is located in my own module folder doesn't get called. I did everything right according to that site, I've copied AdminCatalog.php and AdminProducts.php and changed the path of AdminProducts.php to my own module. I also modified via Employees > Tabs that my own AdminCatalog.php should be used, this is all correct.

Yet it doesn't work, and I found out why: in admin/ajax.php on lines 172-176 there are these lines of code:

if ($step = (int)(Tools::getValue('ajaxProductTab')))
   $catalog = new AdminCatalog();
   $admin = new AdminProducts();

and this code is being called as soon as you click on the Combinations tab in the back office. which means that Prestashop's default AdminCatalog is being called instead of the one provided in my module.

is it possible to override this ajax.php file also? or is there some other way to let prestashop know that it needs to access my AdminCatalog always instead of using it like this in their ajax.php ?

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...