When I want to sort products by price (low to high and high to low), my link is not working. Option value is "price&product_list_dir=asc", which encode in "price%26product_list_dir%3Dasc". How can I decode that url?
Here is my code:
<div class="toolbar-sorter sorter">
<label class="sorter-label" for="sorter"><?php /* @escapeNotVerified */ echo __('Sort by') ?></label>
<select id="sorter" data-role="sorter" class="sorter-options selectpicker">
<?php
$url = $_SERVER['REQUEST_URI'];
$path = strstr($url, '?');
?>
<option
<?php if($path == '?product_list_order=price&product_list_dir=desc'): ?>
selected="selected"
<?php endif; ?>
class="high-low" value="price&product_list_dir=desc">
Price - High to low
</option>
<option
<?php if($path == '?product_list_order=price&product_list_dir=asc'): ?>
selected="selected"
<?php endif; ?>
class="low-high" value="<?php /* @escapeNotVerified */ echo __('price&product_list_dir=asc') ?>">
Price - Low to high
</option>
</select></div>