Site URL: https://www.missr.com.au
I used the coding from previous posts, but it doesn't work with mine.
Knowing nothing about coding, and looking for brilliant people to help me
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script>
$(document).ready(function() {
var urlCat = window.location.href.split(".com/")[1];
if (urlCat == "store") {
var catItem = $('a.nested-category-breadcrumb-link');
var itemTag = $(catItem).html();
var catDrop = "<select name='Categories' id='categories' class='catDrop'><option value='All'>All</option>";
if (itemTag !== undefined) {
catItem.each(function(i) {
var fixLoc = $(this).html().trim().replace(/\s+/g, '-').replace(/&/g, '').replace('amp;', '').replace('--', '-').replace(/'/g,'').toLowerCase();
catDrop = catDrop + '<option value=' + fixLoc + '>' + $(this).html() + '</option>';
i++;
});
catDrop = catDrop + "</select>";
$(catDrop).insertAfter($('.nested-category-title'));
}
if (urlCat !== undefined) {
var fixCat = urlCat.replace(/\%27/g, "'")
$(".catDrop").val("All");
}
$(".catDrop").change(function() {
if ($(this).val() == "All") {
window.location = "/store/";
} else {
window.location = "/store/" + $(this).val();
}
});
}
});
</script>
<style>
.collection-5f36dfec3a07a2182b139d23 .nested-category-children {
display: none !important;
}
.catDrop {
margin-top: 2vh;
margin-bottom: 2vh;
margin-left: 50%;
transform: translateX(-50%);
}
</style>