0

My client needs to display the status of an order, so using relationship channel of order_statuses.

The list of order statuses should be shown as:

  • Order recieved
  • Status 2
  • [TICK] Status 3
  • Status 4
  • Status 5
  • Order Complete

The tick shows that the order is at a specific point in the process...

I could probably use statuses, but need it to sit within a channel to give me more flexibility over what it can store. eg. status icon etc.

1 Answer 1

0

I'd use an embed template inside the product to call all your "status" entries:

Product template example

{exp:channel:entries channel="products"}
    
    <!-- products title -->
    {title} 

    <!-- call embed template with status id as reference -->
    {embed="my_group/my_embed_template" the_status_id="{status_relationship_field:entry_id}"}

{/exp:channel:entries}

Embed template example:

<ul>
<!-- loop through all statuses -->
{exp:channel:entries channel="order_statuses" dynamic="no"}
<li>
    <!-- compare order statuses entry id with embed reference from product -->
    {if entry_id == '{embed:the_status_id}'}<img src="{status_icon}">{/if} 
    <!--  orders status title -->
    {title}
</li>
{/exp:channel:entries}
</ul>

Something like that!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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