How to limit td element to 1

Hi @birdiejay

To ensure that the tracking code for the order is displayed on only one line instead of repeating for each line item, you’ll need to make a couple of changes. The issue occurs because you are using a for loop to display each tracking number for each line item, which results in multiple rows for multiple items.

Solution:1. Display only one tracking number for the entire order:

  • Instead of looping through each line item to show a tracking number, you can find the first tracking number available and display it once.

Here’s how you can modify your code:

Updated Code:

Mobile:


  {{ 'customer.order.tracking_number' | t }}
  
    {% assign tracking_numbers = order.line_items | map: 'fulfillment.tracking_number' %}
    {% assign unique_tracking_numbers = tracking_numbers | uniq %}
    
    {% if unique_tracking_numbers.size > 0 %}
      

        [{{ unique_tracking_numbers.first }}](https://panel.bovo.com.tr/kargo-takip?tracking_number={{ unique_tracking_numbers.first }})
      

    {% endif %}
  

Desktop:

Kargo Takip

  {% assign tracking_numbers = order.line_items | map: 'fulfillment.tracking_number' %}
  {% assign unique_tracking_numbers = tracking_numbers | uniq %}
  
  {% if unique_tracking_numbers.size > 0 %}
    

      [{{ unique_tracking_numbers.first }}](https://panel.bovo.com.tr/kargo-takip?tracking_number={{ unique_tracking_numbers.first }})
    

  {% endif %}

If my reply is helpful, kindly click like and mark it as an accepted solution.
Thanks!
Use our Big Bulk Discount app to boost your sales! :rocket: (https://apps.shopify.com/big-bulk-discount). Easy to set up and perfect for attracting more customers with bulk discounts. Try it now and watch your revenue grow!