How to use attribute target blank in link_to filter ?

Jake38
New Member
1 0 1

Dear All and Shopify staff,

I want to customer click in product name, then open to a new tab. I'm using this below code:

 

 

{{ line_item.title | link_to: line_item.product.url }}

 

 

 

And It only work on open in the same tab. Anyone can help me use attribute target="_blank" at here ?

Thank you so much

Rack
Shopify Partner
6 0 4

I'm looking for the same solution

0 Likes
Rack
Shopify Partner
6 0 4

I tried something similar to this for my situation and it works.

<a href="{{ line_item.title | line_item.product.url }}" target="_blank"></a>

(use an a href instead of the link_to:)

0 Likes