Jump to content

Help with _PS_BASE_URL_


Recommended Posts

Hi there,

 

I have a problem with the links, I tried to reinstal prestashop few times but no results.

 

On categories, info box..etc the link appears like this: http:// mydomain.com/_PS_BASE_URL_/category.php?id_category=6

 

So, I don't unterstand why this _PS_BASE_URL_ appears there and I have no idea how to fix it

 

Thanks

Link to comment
Share on other sites

  • 6 months later...

Now I am having the same problem on a smaller scale: I made a modification in mailalerts.php in which I use _PS_BASE_URL_. In a testshop it works as desired. But when I put the same file in my real shop I get the text " _PS_BASE_URL_ " in the link too.

 

I made a workaround by adding the following (borrowed from elsewhere in PS) before the line with the problem:

 

if (!defined('_PS_BASE_URL_'))
   define('_PS_BASE_URL_', Tools::getShopDomain(true));

 

But is remains a strange dysfunction.

Link to comment
Share on other sites

  • 4 years later...

I know this is an old post, but i am here today because i was searching for an issue with "_PS_BASE_URL_" in  a PS 1.6. I think others could have my same problem.

 

I switched a website from HTTP to HTTPS but a module was not working fine with images, this because their paths were http and not https. In the template there was a useless smarty variable. I spent some time to find how that value was built in the PHP functions.

 

Eventually i found the cause, Prestashop is using 2 different constants, you can find them in the file "classes/controller/Controller.php". Function init().

So we have "_PS_BASE_URL_" for http requests and "_PS_BASE_URL_SSL_" for SSL enabled websites. The bad module was building the image paths using the first one!!! So, i fixed the function with the right version.

Link to comment
Share on other sites

×
×
  • Create New...