 romainO-2
|
I get a "Incompatible Archive." message when I try to upload the woocommerce custom field plugin (zip).
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Perhaps the zip wasn't created properly. As an alternate, you can download the plugin from original source (i.e. author or plugin website) or can download the folder plugin from your site using FTP, then create zip and finally upload to the sandbox - does it work?
|
 romainO-2
|
As an alternate, you can download the plugin from original source (i.e. author or plugin website) : not available any more
or can download the folder plugin from your site using FTP, then create zip : that's what I did
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Thank you for the updates. Perhaps there's a problem with your download via FTP or creating a zip later on.
However, I installed https://wordpress.org/plugins/download-plugins-dashboard/ in your site (as mentioned earlier) and was able to download and then upload the said plugin in the sandbox site (see attached).
Also notice the red marked stuff on the screenshot:
1) Use your code or try without it for the said plugin, to see if it works.
2) Setup WPML first so WCML and WooCommerce can work correctly.
3) WooCommerce is pointing towards some incompatible plugins, I checked and that custom fields plugin was also flagged. But probably that's due to the step #2. Check after setting up WPML, WCML and WC properly.
Let me know when you're done.
|
 romainO-2
|
Hello
It's done.
The bug is still here : hidden link
There is a language switcher in the footer.
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Thank you for the updates, I'll check soon and 'll get back to you accordingly.
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Thank you for waiting on this.
I was able to make some progress but looks like plugin doesn't support much of the translations side. However, I still have some things to check and 'll get back to you accordingly by tomorrow.
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Thank you for your patience and cooperation. I was able to find the solution, please consider following options. Although both are the same but there's a slight difference for understanding.
Option A
1. Set "Product Fields (wccf_product_field)" post type to Translatable in WPML -> Settings -> Post Types Translation (see attached). So you can add product fields in other languages.
2. Go to product fields.
3. Edit the field in default language (you can switch the language from top admin bar).
4. After setting #1, now you should have a "Language" section in the right sidebar (see attached). Click the + icon (for the first time) to add the translation of the field. This 'll open it in ATE but you'll be able to see only a label which you can translate. This is enough till now.
5. After completing the translation return back to the French version (default lang) of the product.
6. Go back to the fields listing page (i.e. Custom Fields -> Product Fields).
7. Switch to the English (secondary lang) from top admin bar and you should now see a field listed like "no label".
8. Open it for editing, add the conditions and other settings like the French version. However, notice that you should've translated the product attributes beforehand. So when you set the condition based on the product attributes, you 'll be able to search their English versions.
9. Save.
10. And it should work just fine in the frontend.
Option B
I think this option is much better than A, because in option A, if you use ATE for translation it creates a vague (random) number named field (point #7 above). So All the steps are same for this option B, except that don't translate the field with ATE.
But create one field in French and one field in English. I've also demonstrated this in the sandbox site:
- French: My New French Field
- English: My New English Field
This gives you the opportunity to name the fields properly, which may be a crucial requirement when dealing with custom orders later (instead of figuring out fields with no labels or vague/random numbers).
In any case, when you'll be editing the secondary language version of the field, WPML 'll warn you about it. Just ignore and click "Edit anyway" to edit the field as needed.
|
 romainO-2
|
Great, thank you Waqas.
Unfortunately, I have spent a long time trying to reproduce it on a copy of the live website, but without success... hidden link
It seems that I cannot configure english custom fields like french ones. I'm not sure it's responsible for the bug, but it may suggest some other problems in the plugin :
- by default, english fields status is weird : neither enabled nor disabled. To enable the field, the button within the english custom field page don't change the page status. We can only do so in the custom fields list page
- impossible to set the field like a text area. When I try to, I get this error : "This field type cannot be selected as it is incompatible with current field type. Create a new field instead."
I don't understand what is the difference between your sandbox site and mine. I have tried disabling all the other plugins and setting a default WordPress theme, it's all the same. Any last suggestion ?
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
I've tried again in your site, even updated WPML plugins to latest versions (released in previous week), corrected WooCommerce Endpoints (need to be in English - a known issue) and then translated (regardless of site's default lang) and synchronized attributes.
But there's always this error in the logs (500 Internal Server Error), when selecting a choice from the 2nd field:
PHP Fatal error: Uncaught Error: Call to undefined method WCCF_FB::radio-en() in /home/serveun/www/wp-content/plugins/woocommerce-custom-fields/classes/fields/field-controllers/wccf-field-controller.class.php:2049
Stack trace:
#0 /home/serveun/www/wp-content/plugins/woocommerce-custom-fields/classes/fields/field-controllers/wccf-field-controller.class.php(1926): WCCF_Field_Controller::print_field(Object(WCCF_Product_Field), NULL, 0, Object(WC_Product_Variation), Array)
#1 /home/serveun/www/wp-content/plugins/woocommerce-custom-fields/classes/wccf-wc-product.class.php(363): WCCF_Field_Controller::print_fields(Array, NULL, 1, NULL, Object(WC_Product_Variation))
#2 /home/serveun/www/wp-includes/class-wp-hook.php(324): WCCF_WC_Product->ajax_refresh_product_field_view('')
#3 /home/serveun/www/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#4 /home/serveun/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /home/serveun/www/wp-admin/admin-ajax.php(192): do_action('wp_ajax_wccf_re...')
#6 {main}
thrown in /home/serveun/www/wp-content/plugins/woocommerce-custom-fields/classes/fields/field-controllers/wccf-field-controller.class.php on line 2049
Notice that this is the same error we found earlier but with less trace because now only a few plugins are active.
So I deleted one any only radio field, from the product fields, although it was disabled but still was being processed. I deleted it from Trash also. And now there's no 500 Internal Server Error at hidden link when changing field choices.
However, still the conditional fields are not being displayed but I guess that's a matter of some appropriate conditions and cleaning up the fields mess.
I'll recommend deleting all fields from all languages, including the Trash (for all languages). Then create 1 field first, follow the steps to translate and see if it works. Then add another, repeat the process and keep going.
I also noticed that even for default language version of the product, sometimes fields do not appear correctly. I suspect some caching may also be involved. So it is better to disable all caches and firewalls (plugins and/or server side) before testing the above mentioned.
|
 romainO-2
|
Hello Waqas,
I really appreciate all the time you spent to help me, but my client prefers move on to a new plugin, as it getting too complicated with this one.
Thank you very much for your help.
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
You're always welcome. I tried my best.
Please feel free to close this ticket in this case and don't hesitate to open a new one whenever you need any help regarding WPML.
Have a great day 🙂
|