I've set up a search box on the homepage, that should link into the Opencart search by passing a URL.
The problem I'm having is that the resulting URL is always unencoded:
store/index.php?route%3Dproduct%2Fsearch%26filter_name=test
What I'm aiming for is
store/index.php?route=product/search&filter_name=test
My current code is:
<?php
$storesearch = $_REQUEST['store-search'] ;
$filter = 'route=product/search&filter_name';
$filtered = html_entity_decode($filter);
?>
<form id="store" method="GET" action="http://localhost/vinmobile/store/index.php?<?php echo $storesearch; ?>">
<input type="text" id="store-search" name="<?php echo $filtered; ?>" value="Store Search" onclick="this.value = '';">
<input type="submit" name="" value="Search">
</form>
<?php echo $filtered; ?> // Just to show it onscreen to make sure it's written correctly
I've tried encode, decode, html_entity_decode, urldecode, rawurldecode...
I've tried the form method as GET, POST
I've tried the variable declaration as $_REQUEST, $_GET, $_POST
Every time, I still end up with the url looking like:
store/index.php?route%3Dproduct%2Fsearch%26filter_name=test
I'm sure it's something simple I've missed, but I 'think' I've tried everything and would be very grateful if someone could point me in the right direction.
Cheers
webecho