In this tutorial we’ll learn how to remove options from Shopp storefront orderby-list.

How to Remove Options from Shopp Storefront Orderby-List

orderby

How to Remove Options from Shopp Storefront Orderby-List

Screen Shot 2013-03-31 at 5.18.05 PM

The shopp('storefront.orderby-list') provides your customers with different ways to sort the products they are viewing. In the starter templates it is setup to provide a drop-down menu with options that shoppers can select. Here is a screenshot of the default options:

In this tutorial, you’ll learn how to remove some of these options by using a filter.

Ensure Shopp Content Templates are Enabled

Begin by setting up Shopp templates. Login to your WordPress Admin and go to Shopp SetupPresentation. Then follow the directions. If you already have templates setup, then you’ll see a checkmark for templates and you can continue to the next section.

Learn more about Shopp templates

Notice: Templates are setup so that we can customize our Shopp without risk of our changes being lost during a future software update.

Locate our functions.php File

Now its time to add the filter to the functions.php file. This file usually resides in your themes folder.

  1. Login to your site with an FTP client (Filezilla is a free option). Then browse to wp-content/themes/yourthemefolder/

  2. Open the functions.php file.

  3. Then copy the code below and paste into your functions.php file and save changes:

add_filter('shopp_category_sortoptions', 'my_sort_options_filter');

function my_sort_options_filter( $sortoptions ) {
    if ( function_exists('is_shopp_page') ) {   
        foreach ( $sortoptions as $value => $label ) {
            if ( $value == 'lowprice' ) unset($sortoptions[ $value ]);
            if ( $value == 'highprice' ) unset($sortoptions[ $value ]);  
        }
    }  
    return $sortoptions;
}

Now browse to your website’s storefront page. Again, that will be http://yourwebsite.com/shop/ or equivalent (if you have changed your page slugs). Click on the drop down menu for Shopp storefront orderby-list and you should now see less options. This is because we have remove the choices “lowprice” and “highprice.”

Here is an example of what it should look like: Screen Shot 2013-03-31 at 5.24.56 PM

Notes

If you paste the code snippet and it doesn’t work, then try relocating it towards the middle of your functions.php file. Be sure to save changes afterwards.

The default option for Shopp storefront orderby-list can be set via WordPress Admin → Shopp SetupPresentationProduct Order.

Avatar of Lorenzo Orlando Caum

By

Lorenzo Orlando Caum is the founder of Enzo12 LLC, a consultancy in Tampa, FL. Lorenzo provides consulting services such as a Shopp upgrade service through Shopp 101. He also recommends using managed WordPress hosting with Shopp because a faster site means more sales. You can learn more about Lorenzo, you can follow @lorenzocaum on Twitter or check out his blog.

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar