Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add Product Variation Attribute Option when Attribute name is in Hebrew #33

Open
iNadav opened this issue Aug 3, 2019 · 2 comments
Labels

Comments

@iNadav
Copy link

@iNadav iNadav commented Aug 3, 2019

Describe the bug
I am trying to create a Variation for a variable type product using WooCommerce Rest API (https://woocommerce.github.io/woocommerce-rest-api-docs/?shell#create-a-product-variation). Sadly, whenever the Attribute's name is in Hebrew, I can not do so. When I send over a "create variation" request, with the attributes id included and an option in hebrew/english, the attribute term is missing in the created variation.
I have seen a fix for that, but I guess it doesn't work anymore. (woocommerce/woocommerce#18436)

cURL Code

curl -X POST https://example.com/wp-json/wc/v3/products/PRODUCTIDHERE/variations \
    -u ck:cs \
    -H "Content-Type: application/json" \
    -d '{
  "regular_price": "10.90",
  "image": {
    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
  },
  "attributes": [
    {
      "id": 2,
      "option": "צבע"
    }
  ]
}'

Actions tried
I tried passing the attribute option in both English and Hebrew and it didn't work. when changing the Attribute name to a name in English (using the WooCommerce WP Admin Panel), everything works as expected- I can create product variations with option values in both Hebrew and English.

Expected behavior
The product variation should be listed with it's attribute/s even when the attribute's name is in Hebrew. I actually don't even pass the attribute name in the "create variation" request so it's really weird. I just pass the attribute's ID. meaning it's the WooCommerce handling code that messes it up.

WordPress Environment
<WordPress 5.2 | OceanWP Theme>

Apache,
WooCommerce version 3.6.5,
PHP 7.1.30,
512mb max upload,
Memory limit 256mb

Thanks in advance.
P.S: Sorry about the previous issues, I just figured out the problem..

@iNadav

This comment has been minimized.

Copy link
Author

@iNadav iNadav commented Aug 4, 2019

Update: There's another bug due to the same controller probably-
When exporting(CSV) a product with a variation attribute name in Hebrew, it gets lost on Import and the product appears with no variation at all.

@claudiosanches claudiosanches transferred this issue from woocommerce/woocommerce Sep 25, 2019
@issue-label-bot

This comment has been minimized.

Copy link

@issue-label-bot issue-label-bot bot commented Sep 25, 2019

Issue-Label Bot is automatically applying the label type: bug to this issue, with a confidence of 0.89. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the type: bug label Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.