eBay Auto Sort by Lowest Price

Auto set sort by price on eBay.ie

  1. // ==UserScript==
  2. // @run-at document-start
  3. // @name eBay Auto Sort by Lowest Price
  4. // @namespace EBY
  5. // @description Auto set sort by price on eBay.ie
  6. // @version 1.01
  7. // @copyright 2020 Chopper
  8. // @include https://www.ebay.ie/sch/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. // Get current URL
  13. var url = window.location.href;
  14.  
  15. // If URL contains already contains a sorting method, don't change it.
  16. if (url.indexOf('_sop=1' || '_sop=2' || '_sop=3' || '_sop=7' || '_sop=10'|| '_sop=12' || '_sop=15' || '_sop=16' || '_sop=18' || '_sop=19' ) > -1){
  17. url += ''
  18. }
  19.  
  20. // If there is no sorting method, sort by lowest price
  21. else{
  22. url += '&_sop=15'
  23. // Load new URL
  24. window.location.href = url;
  25. }