Jump to content

Remove white space and characters from URL in smarty.


Edge_jr

Recommended Posts

Hi,

 

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

 

http%3A%2F%2Flocalhost%2Fdemo2%2Findex.php%3Fid_product%3D20%26controller%3Dproduct%26id_lang%3D1

 

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();
$smarty->assign(array(
'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?

 

-Thanks

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