Announcement

Collapse
No announcement yet.

How do we change the default sort for just one category?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do we change the default sort for just one category?

    How do we change the default sort for just one category?

    For example, IMHO a new products category should by default be sorted by the newest first.
    But perhaps we want the rest of the store in display order (I'm guessing that is what the default setting in on the CTGY template) or bestsellers?

    Logically since we want the most categories sorted by bestsellers, I would use that setting on the CTGY template.

    To get new-products to default differently... I saw the default_sort variable. and thought I could use that to override the default on the new-products category.
    But that didn't work. It is still defaulting to the CTGY setting, bestsellers.

    I tried putting the following SMT code in the ctgy header, ctgy page, and ctgy category listing . It didn't do any good in any of those places.

    <mvt:if expr="(l.settings:category:code EQ 'new-products')"><mvt:assign name="l.settings:category_listing:default_sort" value="'newest'"/></mvt:if>

    So how do I do this?

  • I've never done this, but it makes sense to me that it should work for any regular category page. You could go to the specific category and sort all products on Created.

    Another way to do this is to use a ReadyTheme product listing. We do this on our site to display the 30 most recent products at any given time.

    Todd

    Comment


    • 1) You could append the sort order to the link leading to the category

      /whatever-category.html?sort_by=newest

      (if you don't like that appearance, you could do a redirect in htaccess

      2) you add a custom field that had the sort order and use:
      [code]
      <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:category_listing: products, ':customfield_values:customfields:sortorder, 1)" />
      [code]

      The "1" is direction. so either 1 or -1
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


      • Bruce, you are an absolute gem! Thank you for adding that direction stuff too!

        Comment


        • Another option occurred to me, though might be more maintenance work. Just create a new page template that is a copy of the current one, and use that as the Alternative Page layout for new products. Set that Page templates default setting to "newest."
          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment


          • Originally posted by Bruce - PhosphorMedia View Post
            Another option occurred to me, though might be more maintenance work. Just create a new page template that is a copy of the current one, and use that as the Alternative Page layout for new products. Set that Page templates default setting to "newest."
            That's the method I use
            Leslie Kirk
            Miva Certified Developer
            Miva Merchant Specialist since 1997
            Previously of Webs Your Way
            (aka Leslie Nord leslienord)

            Email me: [email protected]
            www.lesliekirk.com

            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

            Comment

            Working...
            X

            This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

            This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

            Accept