Page 1 of 1

Products Module Sort By Added - Solved

Posted: Mon Dec 13, 2010 4:20 pm
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}

Re: Products Module

Posted: Mon Dec 13, 2010 5:39 pm
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

Re: Products Module

Posted: Mon Dec 13, 2010 7:55 pm
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