Jump to content

Edit History

wolic2

wolic2

Hi,

Using paypal module as an example, if i edit the .tpl directly like this:

<img src="https://test.com?order_id={$order.id_order|intval}&amount={$price|replace:'$ ':''}" />

The URL on frontpage would become:

<img src="https://test.com?offer_id=1234&amp;amount=0.01">

which is destroying the URL by escaping the ampersand symbol.

I have tried multiple ways doing it, including:

Controller:
$this->context->smarty->assign('ampHtml', rawurlencode("&"));

.tpl:
{$ampHtml|escape:'html':'UTF-8'|htmlspecialchars_decode:3}

- and all sorts of encoding and decoding I can find on Google (e.g. tools::encode in Controller & tools::decode in .tpl) but it is still escaping the & symbol!

How can I create a proper URL with GET parameters in .tpl or in controller? Appreciate the assistance, been figuring this for the past 2 hours but futile.

I am using PS 1.6.1.24 and working on paypal module

wolic2

wolic2

Hi,

Using paypal module as an example, if i edit the .tpl directly like this:

<img src="https://test.com?order_id={$order.id_order|intval}&amount={$price|replace:'$ ':''}" />

The URL on frontpage would become:

<img src="https://test.com?offer_id=1234&amp;amount=0.01">

which is destroying the URL by escaping the ampersand symbol.

I have tried multiple ways doing it, including:

Controller:
$this->context->smarty->assign('ampHtml', rawurlencode("&"));

.tpl:
{$ampHtml|escape:'html':'UTF-8'|htmlspecialchars_decode:3}

- and all sorts of encoding and decoding I can find on Google (e.g. tools::encode in Controller & tools::decode in .tpl) but it is still escaping the & symbol!

How can I create a proper URL with GET parameters in .tpl or in controller? Appreciate the assistance, been figuring this for the past 2 hours but futile.

I am using PS 1.6.1.24 and working on paypal module to insert a URL with "&" inside (GET request with params) for pixel tracking

×
×
  • Create New...