Currently I have a select
dropdown filter setup via php like this:
<?php if($this->config->get("config_show_tmall_only")){?>
<?php if(isset($code) && $code=="tmall"){?>
<select id="tmallFilter">
<option value="&code=tmall">Tmall only</option>
<option value="">Taobao & Tmall</option>
</select>
<?php }else{?>
<select id="tmallFilter">
<option value="">Taobao & Tmall</option>
<option value="&code=tmall">Tmall only</option>
</select>
<?php }?>
<?php }?>
It detects if &code=tmall
is in the url and runs the first block
I am appending &code=tmall
through this script that runs exactly how I need
$('#tmallFilter').bind('change', function () {
var brwsr_url=document.URL;
var redirecturl= brwsr_url + $(this).val();
location.href = redirecturl;
});
The problem I am running into is when i need to go back to Taobao & Tmall
I can only add to the url, not strip characters based on that select.
Is there any way I can strip &code=tmall
from the url when I select the Taobao & Tmall
option?