1

I'm getting an error when trying to call a channel entries tag from inside of {items}. If I remove the channel entries it's fine:

{exp:store:checkout}

    {items}

        {exp:channel:entries}
            {title}
        {/exp:channel:entries}

    {/items}

{/exp:store:checkout}

The error is just a notice, but an error nonetheless:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: EE::$typography

Filename: core/EE_Output.php

Line Number: 308

Fatal error: Call to a member function parse_type() on a non-object in /Sites/mysite.com/source/ee/expressionengine/core/EE_Output.php on line 308

Any suggestions?

This is on EE 2.7.2, latest Store.

2 Answers 2

2

When you are looping through the items in your cart/checkout tags you should add entry_id="{entry_id}" to the channel entries tag as the {items} will allow you to output the entry_id of items in the cart. Your template should look something along the lines of:

{exp:store:checkout}
    {items}

        {exp:channel:entries entry_id="{entry_id}" limit="1" dynamic="no"}
            {title}
        {/exp:channel:entries}

    {/items}
{/exp:store:checkout}

Having said that you do not need to use a channel entries loop to get the title, url_title and a bunch of other product related info (you can see the entire list here). You only need to use the channel entries loop if you are trying to grab information that you have stored in other custom fields (images, descriptions, etc).

1

Try moving your {exp:channel:entries} into an embed template like this.

In your main template use:

{exp:store:checkout}
    {items}
        {embed="store/items"}
    {/items}
{/exp:store:checkout}

In your embed template use:

{exp:channel:entries dynamic="no"}
         {title}
{/exp:channel:entries}

*** rename "store" to your correct template group name

7
  • I tried that, but get the same issue. And the Store docs state that an inline template should work fine.
    – Russ Back
    Commented Nov 4, 2013 at 17:11
  • Can you post your full template code please to pastie.org
    – Anna_MediaGirl
    Commented Nov 4, 2013 at 17:25
  • When you are looping through the items loop you should have: {items}{exp:channel:entries entry_id="{entry_id}"}{title}{/exp:channel:entries}{/items} Also you do not need to use {exp:channel:entries} loop to get the {title} element only when you are looping through custom fields Commented Nov 4, 2013 at 19:30
  • 1
    Yup, I gave a bit more detail too Commented Nov 4, 2013 at 21:10
  • 2
    Inline channel entries tags will work in simple situations, but if you do run into parse order issues you should always try using an embed as Anna suggests. Commented Nov 5, 2013 at 7:20

Your Answer

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

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