What's your biggest current challenge? Have your say in Community Polls along the right column.

How to add product name in My Account order history table

How to add product name in My Account order history table

rajj99
Excursionist
18 0 3

Hi there,

 

How to add the product name in the order history table in My Account page?  I was able to add the title Product row in the table but not able to add the code to get the relevant product name in the order history table.

 

<div class="table-wrap">
<table class="full">
<thead>
<tr>
<th>{{ 'customer.orders.order_number' | t }}</th>
<th>{{ 'customer.order.product' | t }}</th>
<th>{{ 'customer.orders.date' | t }}</th>
<th>{{ 'customer.orders.payment_status' | t }}</th>
<th>{{ 'customer.orders.total' | t }}</th>
</tr>
</thead>
<tbody>
{% for order in customer.orders %}
<tr>
<td>{{ order.name | link_to: order.customer_url }}</td>
<td>{{ order.created_at | date: format: 'date' }}</td>
<td>{{ order.financial_status_label }}</td>
<td>{{ order.total_price | money }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

 

Screenshot 2022-08-13 at 01.53.09.jpg

 

Thanks in advance guys 🙂

Replies 12 (12)

ashley880
Tourist
4 0 3

Shopify allows to add product name in the order history table. On the left panel in your Shopify admin, click on Sales Reports. Select a product and click the edit pencil icon. Now on the right panel, you will find two options: Order Statistic and Order Detail. Click on the Order Detail and fill up the order name field. Save changes to add product name in your order history table.

imatikshaikh
Shopify Partner
85 15 14

Hi @rajj99 @, try

customer.order.product_title

 

I may be wrong. But just give it a try

Available for hire, for all small tasks and full store development, theme-based and custom.
If I was able to help you. like my post and mark it as an accepted solution.
Founder @ Ecommerce Gurus Agency
A KodeKult Company | Contact Me via email
rajj99
Excursionist
18 0 3

Thanks a lot for your time, but thats not working 🙂

rajj99
Excursionist
18 0 3

can u try again?

imatikshaikh
Shopify Partner
85 15 14

@rajj99 

try 

customer.order.product.title

I took the reference from here

Shopify Tutorial: The product.liquid template — Learning Liquid

 

Edit: I checked the date on the above shopify info post. It's from way back in 2016. So I'm not sure if it's gonna work. 

Try referring to these two posts

Retrieve customer order product ID Shopify - Stack Overflow

how to call customer product name or ID list - Shopify Community

Available for hire, for all small tasks and full store development, theme-based and custom.
If I was able to help you. like my post and mark it as an accepted solution.
Founder @ Ecommerce Gurus Agency
A KodeKult Company | Contact Me via email
rajj99
Excursionist
18 0 3

Thanks for your efforts bro, but it seems to be not working.

Not sure how shopify did not address this issue.

rajj99
Excursionist
18 0 3

@KetanKumar Please look into above.

KetanKumar
Shopify Partner
37445 3664 12119

@rajj99 

can you try this code

<div class="table-wrap">
<table class="full">
<thead>
<tr>
<th>{{ 'customer.orders.order_number' | t }}</th>
<th>{{ 'customer.order.product' | t }}</th>
<th>{{ 'customer.orders.date' | t }}</th>
<th>{{ 'customer.orders.payment_status' | t }}</th>
<th>{{ 'customer.orders.total' | t }}</th>
</tr>
</thead>
<tbody>
{% for order in customer.orders %}
<tr>
<td>{{ order.name | link_to: order.customer_url }}</td>
<td>{{ line_item.title | link_to: line_item.product.url }}</td>
<td>{{ order.created_at | date: format: 'date' }}</td>
<td>{{ order.financial_status_label }}</td>
<td>{{ order.total_price | money }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
rajj99
Excursionist
18 0 3

@KetanKumar Its showing blank, can you look into it pls.

 

Screenshot 2022-10-01 at 22.47.26.jpg

 

KetanKumar
Shopify Partner
37445 3664 12119

@rajj99 

can you please share store url and your user login details 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing

lalit07yadav
Shopify Partner
1 0 0

hello @rajj99 

here is the perfect solution for displaying product title in order table

 

<div class="table-wrap">
<table class="full">
<thead>
<tr>
<th>{{ 'customer.orders.order_number' | t }}</th>
<th>{{ 'customer.order.product' | t }}</th>
<th>{{ 'customer.orders.date' | t }}</th>
<th>{{ 'customer.orders.payment_status' | t }}</th>
<th>{{ 'customer.orders.total' | t }}</th>
</tr>
</thead>
<tbody>
{% for order in customer.orders %}
<tr>
<td>{{ order.name | link_to: order.customer_url }}</td>
<td>{%- for line_item in order.line_items -%}
{{ line_item.title | link_to: line_item.product.url }}
{%- endfor -%}</td>
<td>{{ order.created_at | date: format: 'date' }}</td>
<td>{{ order.financial_status_label }}</td>
<td>{{ order.total_price | money }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

 

 

Axr162
Excursionist
11 0 12

Hi,

 

Did you ever get this to work?