• Resolved carmolim

    (@carmolim)


    Hello, I’m trying to get the titles of the variations inside the content-product.php but I can’t find a way to retrieve it, I looked inside the variable.php file but didn’t understood how it gets the de title. Someone could help me?

    Thanks!

    https://www.ads-software.com/plugins/woocommerce/

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter carmolim

    (@carmolim)

    I used the first solution that I have posted. But I don’t think it is a good solution, it may work in your case but I’m not sure.

    Thread Starter carmolim

    (@carmolim)

    @sameerpanda in this post: https://www.ads-software.com/support/topic/get-variation-name-from-variation-id/ @mikejolley suggests using this function: get_formatted_variation_attributes(). I think you could use this function, and treat the return to achieve what you wan’t.

    Thank for the response @carmolim. Let me try with this hook. But I think I need little JS to achieve what I want. Please see the following.

    Actually I want to add the variation attribute to my product title. Let me explain with an example.

    Eg:
    Product name: variable product
    Variations: Variation 1 | Variation 2

    Then the product title will be
    Variable Product Variation 1 (When I select variation 1) &
    Variable Product Variation 2 (When I select variation 2)

    Can someone help me achieving this.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘How to get the variation title?’ is closed to new replies.