Reputation: 8367
as default, on list page, the product would list by alphabetic.
we hope to list the products by created date (desc), that is the newest product list the first.
we can set the Sort Order for each product, but it is not easy to change thousand products.
so is there any way (like js) to change the default sort by "Newest Item" on product page?
Upvotes: 0
Views: 648
Reputation: 8367
while first i could think is to load the page by jquery trigger, but it would have one second open page action.
<script type="text/javascript">
// <!--
$(document).ready(function(){
$('#sort').val('newest').trigger('change');
});
// -->
</script>
actually, it's pretty easy to add following js the change url in SideCategoryList panel:
<script type="text/javascript">
// <!--
$(document).ready(function() {
$('.sf-menu li:nth-child(1) a').attr("href", '{base_url}/new-in/?sort=newest');
});
// -->
</script>
Upvotes: 1