Page showing all products on sale in a category

thpsthps Posts: 4Member
Is there a category filter that shows only products on sale within a category? 

5 comments

  • JulienDJulienD Posts: 7Member, Moderator, Lightspeed Staff moderator
    Hi @thps

    There is no filter available within a specific category to display only products that are on sale.

    What you can do is adding a link under Design > Navigation > Default that link to the Offers page:


    The Offers page is a built-in page of the eCommerce platform that displays only items for which you have set a strikethrough discount.
  • michaelsteelemichaelsteele Posts: 42Member
    If you just wanted to restrict to one category, you could also manually create a category (e.g. Camping Sale) and add the discounted products to that using either the category editor or import/export tool.
  • thpsthps Posts: 4Member
    Thanks for the replies guys. It's really unfortunate this functionality doesn't exist. The offers page is not particularly useful for stores with a large amount of skus across many unrelated categories as it cannot be navigated. 

    I've come up with a solution but it only works if the number of skus in a category is small enough to fit on one page without additional pagination. This solution is not right for us but I'm sharing it here in case it can help someone:

    Add this jquery in custom.rain this allows us to hide products that have the class "regprod" based on whether a checkbox is checked or if the url parameter of sale=1 is present.
    <script>
    	$.urlParam = function(name){
    		var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
    		return results[1] || 0;
    	}
        if ( $.urlParam('sale') == "1") {
          $( "#onsale" ).prop('checked', true);
          $( ".regprod" ).hide(); 
    		}
        function saleprod() {
        	if($("#onsale").prop('checked') == true) {
    				$( ".regprod" ).hide(); 
    			} else {
        		$( ".regprod" ).show(); 
        	}
        }
    </script>
    add this to your product div's class field to add the regprod class to all regular priced products
    {% if product.price.price_old <= product.price.price %}regprod{% endif %}
    then add a checkbox to your collection.rain file to show or hide regular priced product
    <form><input id="onsale" type="checkbox" name="onsale" value="onsale" onclick="saleprod()">
    <label for="onsale">On Sale</label></form>
  • thpsthps Posts: 4Member
    I'm super new to e-com and see there is an api. Can calls to the api be made from within rain or is it only for external apps to connect to it?
  • yvigeantyvigeant Posts: 30Member
    thps said:
    I'm super new to e-com and see there is an api. Can calls to the api be made from within rain or is it only for external apps to connect to it?
    No it can't make calls to the API.

    Customization is extremely limited in eCom.

    There are a bunch of variables you can use however:
    https://ecom-support.lightspeedhq.com/hc/en-us/articles/115000277594-3-b-Rain-variables


Sign In or Register to comment.