Jump to content

Remove white space and characters from URL in smarty.


Recommended Posts



I am getting some special characters in URL and want to know how to remove them.




Following is my php function using urlencode and try different possibilities but no result.


public function hookExtraLeft($params)
global $smarty, $cookie, $link;
$id_product = Tools::getValue('id_product');
if (isset($id_product) && $id_product != '')
$product_infos = $this->context->controller->getProduct();
'product_link' => urlencode($link->getProductLink($product_infos)),
'product_title' => urlencode($product_infos->name),
return $this->display(__FILE__, 'blocksharefb.tpl');
} else {
return '';

This is in module "blocksharefb".


Any idea?



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