Posted - 09/27/2020 : 10:01:59
Hi Terry, I ran a few tests on my php test site here https://www.floridasurpluswarehouse.com/dev/latest-products.php Here's the scoop. If you have never enabled the filter bar(s) on your site, and you will never use them, then all you need is <?php $orsortby=8; ?> <?php include "vsadmin/inc/incproducts.php" ?> On the page there. No need for anything else. If you have ever offered the filter bar, or want to use it (it's a good feature to offer, so most sites should use it), then you use my trick. You keep the part above the include line for folks who have never used the resort in the filter bar, but for those visitors who have, you want to use the trick I have. Here is what I have on the test site I linked to <?php $orsortby=8; ?> <?php include "vsadmin/inc/incproducts.php" ?> <!-- Begin Re-sort --> <script type="text/javascript"> var sortvalue = $("div.ectpfsort select.prodfilter").val(); if (sortvalue != "8") { jQuery(document).ready(function($){ $('div.ectpfsort select.prodfilter').val(8).change(); }); } </script> <!-- End Re-sort --> You can hit that link on the test site, and try to use the filter to change the sort and you will see it forces back to "8" which is by date. You can hide the filterbar with div.prodfilterbar {display: none;} If you need help setting it up, let me know. Thanks, David

|