Jump to content

Override content of existing front office page. PS1.7


Recommended Posts

Hello all, I'm new to PrestaShop development.

I'm developing a module which creates a custom form that is shown in the front office. Currently the url for this form is static: http://myweb/module/mymodule/mycontroller

I need the admin to be able to configure the URL of that page. I thought of two ways of doing this:

  1. Letting the admin select an existing page, and then somehow make my module override that page's content with my controller.
  2. Letting the admin to specify a url for my controller.

 

I prefer the first solution so I can take advantage of all PrestaShop page-related stuff, like meta data storage and localization.

Do you know how can I achieve 1 or 2? could you point me to some example or piece of documentation?

Thank you in advance!

 

Edited by ramoneces (see edit history)
Link to comment
Share on other sites

8 hours ago, tapanda.gr said:

You mean for example to assing product with ID 1 and instead of product page your module tpl to be displayed?`

I actually cannot understand what you want to achieve.

Thank you for replying, i'll try to make myself clear:

My module shows in the front-office an advanced search page consisting of a form with filters and a table of products that match those criteria.

Now I need the shop manager to be able to dynamically specify a URL for that search page, like: www.myshop.com/super-cool-search-page

And I thought an easy way of doing that could be:

  1. The shop manager create an ordinary PrestaShop page with localized property values and all:
    1. Meta title: Cool search
    2. URL: www.myshop.com/super-cool-search-page
    3. Meta keywords: cool, search, products
    4. Etc.
  2. The shop manager choses that page in my module's configuration, using a selector.
  3. When some visitor goes to www.myshop.com/super-cool-search-page, they can use my module's outstanding search form.

The thing I don't know how to do is making my module override (or append to) some page's content. Namely, showing module content in an specific page created and chosen by the shop manager.

Link to comment
Share on other sites

I believe you come from wordpress. Because these guys work a lot with "pages". The workflow in PrestaShop, though, is a bit different. Usually you make friendly URL mechanism for your module and the only thing you have to do is update the url of your front controller to whatever you like. Then you access the page as user copy the url and use it as you wish.

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