Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Sébastien Dumont

    (@sebd86)

    @pujithamutyala Thank you for reporting this mismatch. Will review what needs adjusting to fix this and have a patch out asap.

    Thread Starter pujithamutyala

    (@pujithamutyala)

    Thank you. Can you please update this topic once this is fixed?

    Plugin Author Sébastien Dumont

    (@sebd86)

    Yes of course.

    Plugin Author Sébastien Dumont

    (@sebd86)

    @pujithamutyala After reviewing the issue, I find it is related to how WordPress sanitize the slugs. The character e and is replaced with a d

    I don’t see a way to prevent this.

    Thread Starter pujithamutyala

    (@pujithamutyala)

    But if Woocommerce sanitizes the slugs, it should be the same in both product endpoint and product variations endpoint. Why is there a difference?

    In the products endpoint, the attribute name is “attribute_malae?” which is not correct.

    GET https://stokkur.wpcomstaging.com/wp-json/cocart/v1/products/406

    Response Snippet:

    "attributes": {
            "attribute_malae?": {
                "id": 0,
                "name": "Malae?",
                "position": 0,
                "is_attribute_visible": true,
                "used_for_variation": true,
                "options": [
                    "Nei - Baunir",
                    "Já - Filter",
                    "Já - Mokkakanna",
                    "Já - Pressukanna",
                    "Já - Aeropress",
                    "Já - Espresso"
                ]
            }
    Plugin Author Sébastien Dumont

    (@sebd86)

    I don’t know how you have it returning like it does. I have created a variable product with the same attributes and mine return sanitized and match for both endpoints.

    Maybe there is something that you have done differently in the backend that I missed or you have another plugin that filters the attributes but the data fetched is the same.

    I have compared the data returning on the products page vs the REST API and they match.

    Any other information you can share that might help would investigate further.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Attribute field name mismatch in Get Product Details and Get Product Variations’ is closed to new replies.