0

How to add more parameter to URL view product detail.
I need add one more parameter in url of view product detail. Anyone can help me? Thanks!

1

You can add parameter directly after url.

<?php echo $_product->getProductUrl().'?param1=value1&param2=value2' ?>

//Get value using,
echo $this->getRequest()->getParam('param1');
0

I got it working by using the parameter '_query'. See an example below:

$link = $configurableProduct->getUrlInStore([
    '_ignore_category' => false,
    '_query' => ['attrColourId' => 'xxx'],
    ]]);

I hope it helps.

Cheers,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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