Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?



Find us on Facebook

Follow us on Twitter

View our YouTube channel


 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Sorting products
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author  Topic 
Page: of 2

Terry Paulhus
Advanced Member

Canada
474 Posts

Posted - 09/26/2020 :  17:15:29  
So on my front page... I don't have the filter bar going... it just displays the sort... will this work?

Terry (Redsei)

dbdave
ECT Moderator

USA
8737 Posts

Posted - 09/27/2020 :  09:09:32  
Hi Terry, I can check that on my test site here in a bit and reply back.
If it's required, we can just hide it with css I'm sure.

Thanks,
David

dbdave
ECT Moderator

USA
8737 Posts

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

Terry Paulhus
Advanced Member

Canada
474 Posts

Posted - 09/27/2020 :  11:44:16  
Thanks for all your help but it's still not working.

Again, when I spew out a CSV of my products by date, it does not match the same order on the site. Unless I can somehow put in the sort NOT to sort alphabetically as well....

thanks for your time Dave. Really appreciate it.

Terry (Redsei)

dbdave
ECT Moderator

USA
8737 Posts

Posted - 09/27/2020 :  12:14:39  
Hi Terry, tell me this, are the dates on your products, as they show in the admin, the way you expect, and want them to be?

David

Terry Paulhus
Advanced Member

Canada
474 Posts

Posted - 09/27/2020 :  14:55:37  
Yes. The dates are year-month-day

Terry (Redsei)

dbdave
ECT Moderator

USA
8737 Posts

Posted - 09/27/2020 :  20:09:25  
Hi Terry, inn that case, it should be working fine, regardless of any csv download issues.
You do need to have jquery running on the page, and if it's still not working, I can look at the page and probably diagnose the issue.
Post a url, or message one to me.

Thanks,
David
Page: of 2  Topic   
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2019 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000