How to apply PS_BASE_URI to search module?

276 views Asked by At

I am building a search module for Prestashop. I am able to apply the BASE_URI onto my JS and CSS assets so they load fine.

I have an issue where if shops have set a BASE_URI, when they search on my search bar and hit enter, it still goes to <domain>/?query_params, but actually I need it to go to <domain>/BASE_URI/?query_params.

I'm not sure where to start, feels like I need to write some logic in my front controller but I can't seem to find any resources online to point me into the right direction.

2

There are 2 answers

0
Robertino Vasilescu On

Look here, complete list of PS variables

for a full variable list applicable to PS1.6 & 1.7.

It has a search box too so you can search for e.g. "base"

0
Alexander Grosul On

To reach this behavior you need to change action for the search form. If you use PS 1.7 you can do that in themes\yuor_theme\modules\ps_searchbar\ps_searchbar.tpl in line <form method="get" action="{$search_controller_url}"> put your url instead of {$search_controller_url}. If you use PS 1.6 that are files themes\your_theme\modules\blocksearch\blocksearch-top.tpl and themes\your_theme\modules\blocksearch\blocksearch.tpl and change an action there as well.