• Resolved dnaydenov

    (@dnaydenov)


    Hello I’m currently working on API that integrates out platform with woocommerce stores and I’ve noticed that if product attribute is named with cyrillic letters and the slug is not specifically added, the slug copies the name so it too is with cyrillic letters. And when I pull a variation with that type of attribute attached to it, the attribute option return it’s slug instead of
    the name of the option (if the attribute slug does not contains cyrillic symbols the option’s name is returned, as it should be). As you understand this violates the consistency of the returned data, so I would be grateful if you can check out the problem and eventually fix it. Thank you

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support John Coy a11n

    (@johndcoy)

    Automattic Happiness Engineer

    Hi @dnaydenov

    Thanks for reaching out to us. When I create a new product attribute and only define the name Colour? ( with cyrillic letters ), I was able to confirm that that attribute’s name is added to the slug ( e.g pa_colour? )

    Screenshot
    Screenshot link: https://d.pr/i/5kQFRY

    This is where I believe I’m misunderstanding the issue. When I GET a specific product variation by ID, I get that product attribute with the cyrillic letters:

    Screenshot
    Screenshot link: https://d.pr/i/RgPQw5

    Can you confirm this is the data you’re getting when making a request?

    Thread Starter dnaydenov

    (@dnaydenov)

    Thank you for your response, the main issue here is the option.
    As you can see, in your second screenshot the option is actually a slug.
    This is happening only if the attribute’s slug is containing cyrillic symbols, if it is not the option comes as it’s name when the variation data is pulled

    Here is a situation where we have two attribute – one is with slug with cyrillic symbols

    https://snipboard.io/m8AhuQ.jpg

    , the other is having only latin

    https://snipboard.io/DVTPEm.jpg

    When I pull a product with those attributes as you can see one is showing as name(one with latin slug) and the other instead of name is showing as slug

    https://snipboard.io/YEFQOP.jpg

    And when a variation of that product is pulled the options also came back as name for the first one and slug for the other

    https://snipboard.io/1Dbmlc.jpg

    Here are the options/term in the interface comparison

    https://snipboard.io/9jcLy3.jpg

    ,

    https://snipboard.io/1d2JmP.jpg

    If you have more questions I’ll be glad to answer them.

    Plugin Support John Coy a11n

    (@johndcoy)

    Automattic Happiness Engineer

    Thanks @dnaydenov

    I understand now and created an issue on our public repository:

    https://github.com/woocommerce/woocommerce/issues/36138

    I’ll close the thread here but feel free to follow the issue there. Thanks for your contribution to the WooCommerce community, we really appreciate you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Attribute options come as slug’ is closed to new replies.