Jump to content

external requests on my module


Recommended Posts

Hello.

I have to develop a module for PrestaShop. I still developed some modules for other shop systems .. but here I do not know symphony and I have some big understanding problems with the documentation .. maybe someone can bring me on the right way?

I see my module in the PrestaShop .. I have configuration parameters that will be saved. This is all working so far.

Now my module has to do things on external requests. I need URLs like

www.myprestashop.com/modules/mymodule/productcheck.php?article=123

In this file I want to select the article number in the shops database and response some information.

I tried several things to use presta classes (use command, namespace in composer.json) but nothings works for me I always get: Fatal error: Uncaught Error: Class 'xxx' not found. I cannot find an entry point into the symphony framework .. and I also don't know which class to use. The structure of the classes are well documented, but not which is used for what ..

I would need 3 different functions in my plugin ..

1. productcheck as I described obove.
2. addToCart.php?articles=12,14,16 .. (adds these 3 article numbers to the actual shopping cart
3. sales volume tracking .. on checkout I want to post sales data of the actual shopping cart to an endpoint.

To code the functionality will not be the problem. But I do not know which controllers ans classes I will need to do that and where they have to find in the symphony folder structure.

Maybe someone can give me the right shove or hint to solve my problem ?

Link to comment
Share on other sites

From your description 1+2 sound like you are looking to develop  (Module)FrontController - check some examples from standard modules e.g.ps_emailsubscription

3. could be a hook in the checkout process

  • Thanks 1
Link to comment
Share on other sites

Thanks JBW .. the examples from ps_emailsubscription helped me a lot. It was a very good hint from you.

I did not dealed with hooks so far .. maybe I have some questions to that when I read in this topc.

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