Jump to content

(Solved) Using the models outside of PS


doobdargent

Recommended Posts

Hey there ;)

I'm trying to create a custom administration panel for PrestaShop for my father (He wants only the trivial stuff).

 

Actually I'm just copy/pasting and adapting the current models to a MVC framework, and it's working fine. It takes a lot of time of course.

What I am worried about is future evolution. If in a future PS update, the DB scheme change, I would have to manually find and re-adapt my own models system.

 

I'm just wondering if there is a simple way to instantiate those classes? There is so many dependencies!

 

Any hint is deeply appreciated.

Cheers,

Bastien.

Link to comment
Share on other sites

why not just create a new permission group with just the back office stuff your father needs. then you can easily add/delete area's he needs/doesn't need. the beauty is then you don't need to change anything in PS...

 

back office-->empolyees-->profiles

add a new profile

 

then

back office-->employees-->permissions

select the profile you just added

now set the area's that you want your father to work with

Link to comment
Share on other sites

Thnaks for your reply elpatron.

 

I'm not doing this because my friend designed a really awesome and user-friendly UI that is completely different. (Usage of drag&drop everywhere)

 

I'll take a look in the web to see if it's possible to create themes for the administration, I didn't even check that ;)

Link to comment
Share on other sites

Sometimes I forget the basics... Just by looking in the admin/index.php I found the answer.

In order to have access to all PrestaShop classes, we only need to require the config file.

 

<?php
define('_PS_ADMIN_DIR_', getcwd());
require(dirname(__FILE__).'/../config/config.inc.php'); // From any folder in PrestaShop dir
echo Configuration::get('PS_WEIGHT_UNIT'); // kg

 

Jesus I just saved 2 weeks of worthless effort !

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