I have a big doubt that there are many asking the same thing but I do not find anything clear on the internet, I want to know how to change the list / grid, in my products, for now I have this:
<script>
$('button').on('click',function(e) {
if ($(this).hasClass('grid')) {
$('#container div').removeClass('list').addClass('grid');
}else
if($(this).hasClass('list')) {
$('#container div').removeClass('grid').addClass('list');
}
});</script>
when you change the page, it takes the initial value again, (squares) and I want it to be with the class selected by the user. Thanks for the support, I'm really lost.