2

I want to display a list of all orders that were incomplete in a frontend template for Expresso Store. I have template that shows all orders that have been processed something along the lines of :

{exp:store:orders limit="2000"}
    {order_id}
{/exp:store:orders}

In the backend I can see that I can filter by order status == Incomplete. However, when I try to do the same in the template I don't get any results. I tried

{exp:store:orders limit="2000" order_status="Incomplete"}
    {order_id}
{/exp:store:orders}

Any help appreciated.

EDIT:

I'm now using the query module, it spits out the order id, but not the rest of the info I need. The code looks like this:

{exp:query sql="SELECT order_id FROM exp_store_orders ORDER BY order_date DESC LIMIT 2000"}
                <tr>
                  <td>{order_id}</td>
                  <td>{order_date format="%j %M %Y"}</td>
                  <td>{billing_name}</td>
                  <td>{if is_order_paid}Yes{if:else}No{/if}</td>
                  <td>{order_total}</td>
                  <td>{shipping_address1}</td>
                  <td>{shipping_address2}</td>
                  <td>{shipping_address3}</td>
                  <td>{billing_phone}</td>
                  <td>{order_email}</td>
                  {items}
                      {if sku == "FAM-SM" OR sku == "FAM-4-S"}
                        {modifiers limit="1"}
                            <td>{modifier_value}</td>
                        {/modifiers}
                        <td>N/A</td>
                      {if:else}
                        {modifiers}
                            <td>{modifier_value}</td>
                         {/modifiers}
                      {/if}
                      {if sku == "FAM-4-S"}
                        <td>{order_custom3}</td>
                        <td>{order_custom4}</td>
                        <td>{order_custom5}</td>
                      {if:else}
                          <td>N/A</td>
                          <td>N/A</td>
                          <td>N/A</td>
                      {/if}
               {/items}

                </tr>
            {/exp:query}
  • If you want to pull more then just the order_id you need to tell the query to select it something along the lines of {exp:query sql="SELECT * FROM exp_store_orders ORDER BY order_date DESC LIMIT 2000"} would allow you to use all of the table's column names in your templates. – Justin Long May 31 '14 at 20:54
1

I don't have store installed on my sandbox to text with right this second, but worst case you could always pull this information via the exp:query module

It'd go something like

{exp:query sql="SELECT order_id FROM exp_store_orders ORDER BY order_date DESC LIMIT 2000"}
    {order_id}
{/exp:query}

You can ORDER BY whatever works, probably by order_id itself and have a list of the last 2000 orders

  • Thanks for that. I'm able to get the order_id but not the rest of the information I'm looking for. I've updated my post above with the full code I'm trying to use. – steve May 30 '14 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.