Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 13 replies, has 2 voices.

Last updated by Marcel 1 month ago.

Assigned support staff: Marcel.

Author Posts
September 14, 2020 at 6:59 pm #7012659

jeroen-bartolB

The client is adding products using the WPML API but they do not show on the frontend of the site until they are updated/edited via the WooCommerce Multilingual interface.

September 15, 2020 at 12:49 pm #7018333

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

HI,

my name is Marcel and I will take over your ticket.

Possible an easy problem. For my side, I add translations of products via the WPML api. If I do that, the translation end up in the in queue and only when I press on edit and save, the product will appear in the webshop. Having many special products, it takes a lot of work to add all translations

#1 Could you please past me your existing code so that I can see how you add translations of products via the WPML API?

#2 Could you please provide me with site access so that I can reproduce the issue myself?

I would need to request temporary access (WP-Admin and FTP) to your site
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed

Your next answer will be private which means only you and I have access to it.

❌ Please backup your database and website ❌

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

Thank You

Best Regards
Marcel

September 20, 2020 at 6:31 pm #7054441

jeroen-bartolB

One thing. Both sites (live and dev) run on the same server.

September 21, 2020 at 9:48 am #7057995

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi,

I receive "Fout: Het ingevoerde wachtwoord voor de gebruikersnaam *** is onjuist. Wachtwoord vergeten?" . Could you please re-check this?

Please also add me the steps/code on how you add the products over the API, so that I can reproduce it myself.

Thanks.

Best Regards

September 22, 2020 at 6:20 pm #7072291

jeroen-bartolB

I will send the xml later; currently on holiday making it a bit more difficult to get the exact xml that is send to the site.

September 23, 2020 at 5:13 pm #7082965

jeroen-bartolB
{[{"id":10367,"name":"Spinosaurus Tand","slug":"spinosaurus-tand","permalink":"https:\/\/dev2.fossilshop.eu\/product\/fossielen\/dinosaurussen-fossielen\/spinosaurus-fossielen\/spinosaurus-tand\/","date_created":"2020-09-23T16:56:54","date_created_gmt":"2020-09-23T16:56:54","date_modified":"2020-09-23T16:56:54","date_modified_gmt":"2020-09-23T16:56:54","type":"simple","status":"publish","featured":false,"catalog_visibility":"visible","description":"<p>De grootte van deze spinosaurus tand is 5.0 cm. Het fossiel is gevonden in Kem Kem Hamada, Marokko en komt uit het Krijt (145- 66 miljoen jaar geleden).<\/p>\n","short_description":"","sku":"TF-066","price":"25.00","regular_price":"25.00","sale_price":"","date_on_sale_from":null,"date_on_sale_from_gmt":null,"date_on_sale_to":null,"date_on_sale_to_gmt":null,"price_html":"<span class=\"woocommerce-Price-amount amount\"><bdi><span class=\"woocommerce-Price-currencySymbol\">&euro;<\/span>25.00<\/bdi><\/span>","on_sale":false,"purchasable":true,"total_sales":0,"virtual":false,"downloadable":false,"downloads":[],"download_limit":-1,"download_expiry":-1,"external_url":"","button_text":"","tax_status":"taxable","tax_class":"","manage_stock":true,"stock_quantity":1,"in_stock":true,"backorders":"no","backorders_allowed":false,"backordered":false,"sold_individually":false,"weight":"10","dimensions":{"length":"","width":"","height":""},"shipping_required":true,"shipping_taxable":true,"shipping_class":"","shipping_class_id":0,"reviews_allowed":true,"average_rating":"0.00","rating_count":0,"related_ids":[],"upsell_ids":[],"cross_sell_ids":[],"parent_id":0,"purchase_note":"","categories":[{"id":23,"name":"Spinosaurus","slug":"spinosaurus-fossielen"}],"tags":[],"images":[{"id":10365,"date_created":"2020-09-23T16:56:53","date_created_gmt":"2020-09-23T16:56:53","date_modified":"2020-09-23T16:56:54","date_modified_gmt":"2020-09-23T16:56:54","src":"https:\/\/dev2.fossilshop.eu\/wp-content\/uploads\/2020\/09\/TF-066_LRG.jpg","name":"Spinosaurus Tand","alt":"","position":0}],"attributes":[],"default_attributes":[],"variations":[],"grouped_products":[],"menu_order":0,"meta_data":[{"id":40225,"key":"_wpml_word_count","value":"{\"total\":0,\"to_translate\":{\"nl\":33,\"en\":33}}"}],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spinosaurus Tand - Fossilshop.eu<\/title>\n<!-- Opmerking voor de admin: deze pagina toont geen meta description omdat het geen heeft. Dit kun je oplossen door er een voor deze pagina te schrijven of ga naar het [SEO - Zoekweergave] menu en stel een template in. -->\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spinosaurus Tand - Fossilshop.eu\" \/>\n<meta property=\"og:description\" content=\"De grootte van deze spinosaurus tand is 5.0 cm. Het fossiel is gevonden in Kem Kem Hamada, Marokko en komt uit het Krijt (145- 66 miljoen jaar geleden).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dev2.fossilshop.eu\/product\/fossielen\/dinosaurussen-fossielen\/spinosaurus-fossielen\/spinosaurus-tand\/\" \/>\n<meta property=\"og:site_name\" content=\"Fossilshop.eu\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fossilshop\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dev2.fossilshop.eu\/#website\",\"url\":\"https:\/\/dev2.fossilshop.eu\/\",\"name\":\"Fossilshop.eu\",\"description\":\"Fossielen en mineralen\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/dev2.fossilshop.eu\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"nl\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/dev2.fossilshop.eu\/product\/fossielen\/dinosaurussen-fossielen\/spinosaurus-fossielen\/spinosaurus-tand\/#primaryimage\",\"inLanguage\":\"nl\",\"url\":\"https:\/\/dev2.fossilshop.eu\/wp-content\/uploads\/2020\/09\/TF-066_LRG.jpg\",\"width\":800,\"height\":439},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dev2.fossilshop.eu\/product\/fossielen\/dinosaurussen-fossielen\/spinosaurus-fossielen\/spinosaurus-tand\/#webpage\",\"url\":\"https:\/\/dev2.fossilshop.eu\/product\/fossielen\/dinosaurussen-fossielen\/spinosaurus-fossielen\/spinosaurus-tand\/\",\"name\":\"Spinosaurus Tand - Fossilshop.eu\",\"isPartOf\":{\"@id\":\"https:\/\/dev2.fossilshop.eu\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dev2.fossilshop.eu\/product\/fossielen\/dinosaurussen-fossielen\/spinosaurus-fossielen\/spinosaurus-tand\/#primaryimage\"},\"datePublished\":\"2020-09-23T16:56:54+00:00\",\"dateModified\":\"2020-09-23T16:56:54+00:00\",\"inLanguage\":\"nl\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dev2.fossilshop.eu\/product\/fossielen\/dinosaurussen-fossielen\/spinosaurus-fossielen\/spinosaurus-tand\/\"]}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","translations":[],"lang":"nl","_links":{"self":[{"href":"https:\/\/dev2.fossilshop.eu\/wp-json\/wc\/v2\/products\/10367"}],"collection":[{"href":"https:\/\/dev2.fossilshop.eu\/wp-json\/wc\/v2\/products"}]}}]}
September 23, 2020 at 5:14 pm #7083001

jeroen-bartolB

The last replay is the XML that is send to add the product.

September 23, 2020 at 5:20 pm #7083003

jeroen-bartolB
{{"id":10371,"name":"Spinosaurus Tooth","slug":"spinosaurus-tooth","permalink":"https:\/\/dev2.fossilshop.eu\/product\/uncategorized\/spinosaurus-tooth\/?lang=en","date_created":"2020-09-23T17:19:33","date_created_gmt":"2020-09-23T17:19:33","date_modified":"2020-09-23T17:19:33","date_modified_gmt":"2020-09-23T17:19:33","type":"simple","status":"publish","featured":false,"catalog_visibility":"visible","description":"The size of this spinosaurus tooth is 9.0 cm. The fossil has been found in Kem Kem Hamada, Morocco and is from the Cretaceous (145- 66 million years ago).","short_description":"","sku":"","price":"45.00","regular_price":"45.00","sale_price":"","date_on_sale_from":null,"date_on_sale_from_gmt":null,"date_on_sale_to":null,"date_on_sale_to_gmt":null,"price_html":"<span class=\"woocommerce-Price-amount amount\"><bdi><span class=\"woocommerce-Price-currencySymbol\">&euro;<\/span>45.00<\/bdi><\/span>","on_sale":false,"purchasable":true,"total_sales":0,"virtual":false,"downloadable":false,"downloads":[],"download_limit":-1,"download_expiry":-1,"external_url":"","button_text":"","tax_status":"taxable","tax_class":"","manage_stock":false,"stock_quantity":null,"in_stock":true,"backorders":"no","backorders_allowed":false,"backordered":false,"sold_individually":false,"weight":"","dimensions":{"length":"","width":"","height":""},"shipping_required":true,"shipping_taxable":true,"shipping_class":"","shipping_class_id":0,"reviews_allowed":true,"average_rating":"0","rating_count":0,"related_ids":[],"upsell_ids":[],"cross_sell_ids":[],"parent_id":0,"purchase_note":"","categories":[{"id":15,"name":"Uncategorized","slug":"uncategorized"}],"tags":[],"images":[{"id":0,"date_created":"2020-09-23T17:19:34","date_created_gmt":"2020-09-23T17:19:34","date_modified":"2020-09-23T17:19:34","date_modified_gmt":"2020-09-23T17:19:34","src":"https:\/\/dev2.fossilshop.eu\/wp-content\/uploads\/woocommerce-placeholder.png","name":"Placeholder","alt":"Placeholder","position":0}],"attributes":[],"default_attributes":[],"variations":[],"grouped_products":[],"menu_order":0,"meta_data":[{"id":40277,"key":"_wpml_word_count","value":"{\"total\":0,\"to_translate\":{\"nl\":34,\"en\":34}}"}],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spinosaurus Tooth - Fossilshop.eu<\/title>\n<!-- Opmerking voor de admin: deze pagina toont geen meta description omdat het geen heeft. Dit kun je oplossen door er een voor deze pagina te schrijven of ga naar het [SEO - Zoekweergave] menu en stel een template in. -->\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spinosaurus Tooth - Fossilshop.eu\" \/>\n<meta property=\"og:description\" content=\"The size of this spinosaurus tooth is 9.0 cm. The fossil has been found in Kem Kem Hamada, Morocco and is from the Cretaceous (145- 66 million years ago).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dev2.fossilshop.eu\/product\/uncategorized\/spinosaurus-tooth\/?lang=en\" \/>\n<meta property=\"og:site_name\" content=\"Fossilshop.eu\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fossilshop\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dev2.fossilshop.eu\/#website\",\"url\":\"https:\/\/dev2.fossilshop.eu\/\",\"name\":\"Fossilshop.eu\",\"description\":\"Fossielen en mineralen\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/dev2.fossilshop.eu\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"nl\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/dev2.fossilshop.eu\/product\/uncategorized\/spinosaurus-tooth\/?lang=en#primaryimage\",\"inLanguage\":\"nl\",\"url\":\"https:\/\/dev2.fossilshop.eu\/wp-content\/uploads\/2020\/09\/TF-072_LRG.jpg\",\"width\":800,\"height\":385},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dev2.fossilshop.eu\/product\/uncategorized\/spinosaurus-tooth\/?lang=en#webpage\",\"url\":\"https:\/\/dev2.fossilshop.eu\/product\/uncategorized\/spinosaurus-tooth\/?lang=en\",\"name\":\"Spinosaurus Tooth - Fossilshop.eu\",\"isPartOf\":{\"@id\":\"https:\/\/dev2.fossilshop.eu\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dev2.fossilshop.eu\/product\/uncategorized\/spinosaurus-tooth\/?lang=en#primaryimage\"},\"datePublished\":\"2020-09-23T17:19:33+00:00\",\"dateModified\":\"2020-09-23T17:19:33+00:00\",\"inLanguage\":\"nl\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dev2.fossilshop.eu\/product\/uncategorized\/spinosaurus-tooth\/?lang=en\"]}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","translations":{"nl":"10370"},"lang":"en","_links":{"self":[{"href":"https:\/\/dev2.fossilshop.eu\/wp-json\/wc\/v2\/products\/10371"}],"collection":[{"href":"https:\/\/dev2.fossilshop.eu\/wp-json\/wc\/v2\/products"}]}}} 
September 23, 2020 at 5:23 pm #7083051

jeroen-bartolB

And the last one is the translation for the product.

September 24, 2020 at 8:38 am #7088187

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi,

these are not XML files. These are JSON Files.

Do you add the products using REST-API tools such as POSTMAN or do you add it over code/? I see you have a configured API Key in Woo. Can you please add step by step what you were doing & keys so that I can reproduce this issue myself?

Please let me know.Thanks

Best Regards
Marcel

September 24, 2020 at 10:06 am #7089337

jeroen-bartolB

You are right, these are the JSON file. To add the products, I have created my own code in MVC / C#. To create the JSON files to add the products I use the WooCoomerceNET nuget package (hidden link). Since this nuget does not include the option to translate things, I have extended the nuget to include translation. So what I do:

I first add a product in Dutch to the website. These include the following parameters:

                
name = product.NameNL,
weight = product.SendInBox ? 2000 : product.Weigth,
description = product.DescriptionNL,
price = decimal.Round(product.Price, 2, MidpointRounding.AwayFromZero),
images = imageList,
sku = product.Sku,
categories = catagories,
regular_price = decimal.Round(product.Price, 2, MidpointRounding.AwayFromZero),
stock_quantity = 1,
 manage_stock = true,
 shipping_class = product.SendInBox ? "Pakket" : "Brievenbus pakket",
 lang = "nl"

After adding the product, I add the translation. This is done by first looking for the Id of the product I want to translate. I do this this by using an the above nuget package and the SKU code of a product and make a call to the api. This will result in the Id of the product which I use to add the english translation using the following code:

   
 var p = new WooCommerceNET.WooCommerce.v2.Product
            {
                name = product.NameENG,
                type = "simple",
                regular_price = decimal.Round(product.Price, 2, 
                MidpointRounding.AwayFromZero),
                description = product.DescriptionENG,
                lang = "en",
                translation_of = id
            };
September 24, 2020 at 10:08 am #7089339

jeroen-bartolB

How can I send a private message for the api keys?

September 25, 2020 at 9:52 am #7098175

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi,

the next answer is marked as private. Thanks

Best Regards
Marcel

September 25, 2020 at 1:52 pm #7100067

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi,

thanks! To check if the issue is on our side or related to your custom code /NuGet (which would be out of the scope of our support), can you please try if you can add the products over a POST Request with a REST Client such as Postman? Here is doc about this process: hidden link

This way, we can check if the issue is reproducible without any custom code modification.

Please let me know.

Best Regards
Marcel

The topic ‘[Closed] Products added via API are not showing on frontend’ is closed to new replies.