Following Store official documentation I'm trying to include the content of some custom fields inside my {exp:store:checkout}{/exp:store:checkout} tags. According to the docs:
Inside the {items} loop, you can use the following variables.
entry_id
The entry id of this item. If you need to access other custom fields associated with this item, you can feed the entry id into a channel entries loop:
{items} {exp:channel:entries entry_id="{entry_id}"} {my_custom_field} {/exp:channel:entries} {/items}
So I tried to use the following code:
{items}
<tr class="item_row">
<td class="item">
{exp:channel:entries channel='books' entry_id='{entry_id}'}
{book_author}
{/exp:channel:entries}
<h4><a href="{path='store/product'}/{url_title}">{title}</a> </h4>
</td>
<td class="price">{price}</td>
<td class="qty"><input name="items[{key}][item_qty]" value="{item_qty}" class="input-mini" /></td>
<td style="text-align:right" >{item_subtotal}</td>
</tr>
{/items}
but the content of the {book_author} custom field doesn't show up. Switching the template debug on I can see that the entry_id is retrieved:
`{exp:channel:entries channel='books' entry_id='30'}
(0.075356 / 7.57MB) Closing Tag Found
(0.075517 / 7.59MB) Tag: {exp:channel:entries channel='books' entry_id='35'}
(0.075568 / 7.57MB) Closing Tag Found`
so everything looks ok, but a few lines below I read:
(0.093014 / 9.06MB) Calling Class/Method: Channel/entries
(0.093276 / 9.06MB) -> Class Called: Channel
(0.095509 / 9.22MB) -> Method Called: entries
(0.116360 / 10.72MB) Returning No Results Content
(0.116438 / 10.72MB) -> Data Returned
I also tried to use CE_image plug-in to put a tumbnail inside the checkout page, but the plug-in tag is not processed, and the plugin's own debug details don't show-up either.
All the other product details show-up so the {exp:store:checkout} tag seems to work, that is all the details that are not called inside the exp:channel:entries loop.
Is there a reason why the code above doesn't work?
books
channel? (try removing the channel parameter). If you put{entry_id}
in the template right above your channel entries tag, does it output the expected entry ID?{entry_id}
variable before the channel entries tag, outputs the right ID. However the entry id/s was/were correctly retrieved anyway, as my debug log shows. The problem seem to show up only with custom fields. Regarding the channel parameter: removing it as @AdrianMacneil suggested didn't make any difference. As a matter of fact I added the channel par. 'cause the example from the doc didn't work.