• Resolved neyiox

    (@neyiox)


    Hi !

    I created a custom tab in my-account page and I would like to display downloaded products with specific tags. So I need to separate the downloads in two tabs. Add downloads with specific tags in the new tab and remove these downloads from the official Downloads tab.

    I followed this doc to add a new tab with content : https://github.com/woocommerce/woocommerce/wiki/Customising-account-page-tabs

    I know that I can display product with specific tag with if ( is_product_tag( 'digital-courses' ) ) {} but then I’m lost..

    Thank you in advance for your help !

    • This topic was modified 4 years, 6 months ago by neyiox.
Viewing 2 replies - 1 through 2 (of 2 total)
  • jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @neyiox If you used the template at woocommerce/templates/myaccount/downloads.php for your custom endpoint, then you should be able to create a foreach loop to iterate through the $downloads array. From there each download has a product id that can be used to query the product and/or its tags to see if they match. If there’s no match, then the download can be removed from the array.

    If you need further assistance with creating the code for this, we suggest reaching out to the developer resources found here: https://woocommerce.com/customizations/

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved. If you have any further questions, a new thread can be opened.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display downloaded products with tag’ is closed to new replies.