Products Module Sort By Added - Solved

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jeverd01
Forum Members
Forum Members
Posts: 20
Joined: Thu May 20, 2010 2:00 am

Products Module Sort By Added - Solved

Post by jeverd01 »

Ok I am confused, there is a sort function on the products tab in the admin area. I set this to date added. I am trying to achieve a list of the newest products added. Currently it is still sorting by name. Any help would be appreciated.  I edited my summary template to look as follows:

Newest Items


{if isset($catformstart)}
{$catformstart}
{$catdropdown}{$catbutton}
{$catformend}
{/if}

{if isset($pagecount) && $pagecount gt 1}
{$firstlink} {$prevlink}  {$pagetext} {$curpage} {$oftext} {$pagecount}  {$nextlink} {$lastlink}
{/if}
{counter assign=idx print=0}
{foreach from=$items item=entry}





{counter}
   {if $idx fields hash
    and to categories via the $entry->categories array of objects.  Also
    attribute information is available via $entry->attributes.
    you should use the get_template_vars and the print_r modifier to see
    what is available
   *}
 
    detail_url}"  class="ProductDirectoryItem">{$entry->product_name}
{if isset($entry->fields)}

 {foreach from=$entry->fields key='name' item='field'}



      {if $field->type == 'image' && $field->name == 'Image1' && isset($field->thumbnail)}
        file_location}/{$field->thumbnail}" alt="{$field->value}"/>
      {/if}


 {/foreach}



{/if}
{/if}
{/foreach}
Last edited by jeverd01 on Mon Dec 13, 2010 7:56 pm, edited 1 time in total.
Coldman
Power Poster
Power Poster
Posts: 318
Joined: Sun Jun 22, 2008 5:33 am

Re: Products Module

Post by Coldman »

How does your Product tag look like? Do you have sortby=""?

In help you can see this

Code: Select all

(optional) sortby="product_name" - Applicable in the summary, categorylist or search actions, this parameter determines the sorting of the output. Possible values are:

    * product_name
    * id -- The product id
    * weight -- The product weight
    * price -- The product base price
    * status -- Draft or published
    * random -- Display in random order on each request
    * created -- The creation date for this company record
    * modified -- The modified date for this company record
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
jeverd01
Forum Members
Forum Members
Posts: 20
Joined: Thu May 20, 2010 2:00 am

Re: Products Module

Post by jeverd01 »

Thank you very much, it's working now! I didn't even think to look for an attribute since it was an option in the admin panel!  :o
Post Reply

Return to “Modules/Add-Ons”