Jump to content

[SOLVED] Adding Custom Report Tab


Recommended Posts

I've developed my first PrestaShop site that also required creating a custom sales report.

My problem is figuring out how to integrate my report into the admin back end of PrestaShop.
I've created a 'Reports' tab and placed it under 'Tools', but found it doesn't work because the "Class" value is wrong.

When creating a new tab, what the "Class" value be set to? Am I missing a step?


My goal is to end up with a "Reports" tab that will hold the PHP report I've created (and others later on).


Thanks for any help you can offer!
Cokenour

Link to comment
Share on other sites

[sOLVED] Here's what I did to create my own custom reports tab (yes, I'm a PS newbie, but hopefully this will help others):

1. FTP'd down AdminTools.php
2. Renamed AdminTools.php to AdminReports.php (could be whatever name you want)
3. Opened AdminTools.php and changed any references to AdminTools to AdminReports.
4. Save AdminReports.php and FTP up to the site in the same directory where AdminTools.php was located.
5. Login to the admin back end of PrestaShop.
6. Goto Tools >> Tabs >> click "Add New".
7. Enter the name (I used "Reports"); Class=AdminReports; img (your choice, I copied the translations icon, colored it in Photoshop and use that); Parent="Home".
8. Click Save.

The "Reports" tab will now appear in your admin tabs list. REMEMBER: it's sill a copy of the "AdminTools.php" file, so it's functioning the same way. You'll need to go back to the "AdminReports.php" file and edit it to include whatever functionality you want.

In my scenario, this is a great solution because now I can create custom PHP sales reports that will run from this page and just as importantly, because it's in the PrestaShop admin area I can create a "Reports" user and restrict their permissions to ONLY use the reporting feature.

This is what I came up with. Please correct anything that could be done better.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Thanks for your plublisement your experience on how to add the tabs on Prestashop framework.
This is really helpful to me.
In fact i tried to search for this solution on the internet,
but i just found 1 from you.

Thanks again...........,

Link to comment
Share on other sites

  • 1 month later...

I was looking around for a sales report but can't seem to find one which shows products purchased.

Just came up with this thread so I can have a nice tab for reports but saly nothing to go under it.

What are all the live shops doing about monitoring sales and picking products etc?

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...
  • 2 months later...

how can i show content of configure plugin in this new copy of file?

include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php');


class AdminBlog extends AdminTab
{
   public function postProcess()
   {
   }

   public function display()
   {
        >>>>>>> WHAT HERE <<<<<<
   }
}



i want assign content showed after clicking configure of one of plugins > direct in tab for better access

anyone?

THANKS!

Link to comment
Share on other sites

  • 2 months later...
  • 2 years later...
×
×
  • Create New...