News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

fix "orderby" in view categories

Started by charlesmdq, May 26, 2020, 18:09:11 PM

Previous topic - Next topic

charlesmdq

I want to fix the "orderby" of the products view in the categories. Selecting an order and then going to another category reverses this one.
As you will see in this link https://www.disegnowebologna.it/pendra1/catalogo/narrativa-1.html it is displayed correctly with the entry order that is "uscita" (by date - newest to oldest) and to change order to "Titolo book" is done correctly.
Now if I change the category the order should go back to "uscita (by date) from newest to oldest, but no .. Go back to" uscita but inverted, (the oldest first).
Is there a way that when clicking on a category (being in one), the variable "orderby" is reset ?, I'm trying but I can't find the correct function.

$(#sp-right li a).click(function(){
    //reset variable
   <?php unset($this->orderByList['orderby']);?>
});
I already know that php runs on the server side and js on the client, but it is more or less the idea for it to be understood.
can anybody help me? Thank you