Before I used to do this:
$response['url'] = Mage::getBaseUrl() .'module/controller/action?sku=' . $request['sku'] . '&qty=';
Now I am required to use ::getUrl(), but I can't seem to understand how to make use of the reserved special values (tutorial here).
So now I do this:
$response['url'] = Mage::getUrl('module/controller/action', array('sku_query' => $item['sku'], 'qty_query' => ''));
and my url string comes out like this: ...module/controller/action/sku_query/skuValue/
instead of with ? and & for the GET query strings. And also the qty is missing...
Whereas, I want it to look like ...module/controller/action?sku=skuValue&qty=
Screenshot from the debugger, to check the value of the url:

How the code looks:
Mage::getUrl('orderbysku/producttype/showpopupinproductviewpage', array('_query' => 'sku='.$item['sku'].'&qty='))
This should do the trick:
Mage::getUrl(
'module/controller/action',
array('_query' => 'sku=' . $item['sku'] . '&qty=')
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With