1

I have a dropdown on Menu bar called Offers. In that 3 options are there
1. 15%
2. 2%
3. 3%
On onchange I want to sent current URL alongwith parameters.
Suppose current url = https://test.com/test/test.html

I have passed url in this format https://test.com/test/test.html?param=15

1) But I want to pass url in this format - https://test.com/test/test.html/15
I tried in this format i.e https://test.com/test/test.html/15 but it is redirecting to index.php page.

2) Is this is the right way to pass parameters - https://test.com/test/test.html?param=15

1 Answer 1

0

For your case query no. 2 is right, this is valid.

Demo,

You can pass it like below,

$url = Mage::getUrl('modulename/controller/action', array('param1'=>'value1', '_query'=>array('param1'=>'value1', 'param2'=>'value2')));

First, if you want to pass parameter,

$url = Mage::getUrl('module/controller/action', array('param1'=>'15'));

Display like this, https://test.com/test/test.html/param1/15

if you want to pass query parameter,

$url = Mage::getUrl('modulename/controller/action', array('_query'=>array('param1'=>'14'))); https://test.com/test/test.html?param1=15

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.