-
Notifications
You must be signed in to change notification settings - Fork 67
Variation Attribute not synced #5
Comments
@phoenix4rmhell I don't think the problem is in the function logic here , you an do two things to make sure : After disabling all plugin in your site except for
If non of that worked for you and that might be strange , add this function somewhere in your theme funciton file then navigate to your post in default language in the wp admin and paste the result you see here please . add_action('admin_ini', function() {
var_dump(get_post_meta(@$_GET['post']));
}); |
Just for the test I tried adding some code in in function protected function copyVariationMetas($from, $to){...} if I change this code foreach ($metas[$key] as $termSlug) {
$term = get_term_by('slug', $termSlug, $tax);
if ($term) {
$lang = isset($_GET['new_lang']) ? esc_attr($_GET['new_lang']) : pll_get_post_language($this->to->id);
$translated[] = get_term_by('id', pll_get_term($term->term_id, $lang), $tax)->slug;
}
} to: foreach ($metas[$key] as $termSlug) {
$term = get_term_by('slug', $termSlug, $tax);
if ($term) {
$lang = isset($_GET['new_lang']) ? esc_attr($_GET['new_lang']) : pll_get_post_language($this->to->id);
$translated[] = get_term_by('id', pll_get_term($term->term_id, $lang), $tax)->slug;
}else{
$translated[] = $termSlug;
}
} then it starts working fine. Regards, |
@phoenix4rmhell thank you for the great effort in explaining the issue , but I have to ask you this question to make sure before I go any deeper in this issue , have you translated the attributes you are using to generate the variations ? as it seems in the photos , you did not ? am I right ? |
@hyyan I'm not sure how to translate the attributes. Is there any interface to translate the attributes on admin section or do I have to add the translation for attributes in translation files? |
@phoenix4rmhell The plugin does not create any new interface , but it uses the current avaliable woocommere and polylang interface. To translate your attributes follow these steps in the images below : if you have created attributes when you created your product in the default language , then go on and translate you created attributes in the same interface before you start creating translation for your product . Hope that helps ! |
@hyyan Thank you very much for the support. I didn't know about attribute translation. Everything seems to be working fine now. |
@phoenix4rmhell you are more than welcome , and please do not hesitate to ask more questions , I'll always be here to help . |
Hello, |
Hi guys, @dharamgoyal suppose this helps with hindi too |
Hello Hyyan, everything work perfect except that when translate product the new translated product come absolute empty. Only the name and product description is translated. Noting more. Noting more inside. Price, attributes, Taxes, even image is empty. I have about 1900 products if i must add those attributes manual will cost me months. Look examle: Upload photos. Any advice will be most welcome: Thx in advanced: Kind Regards: Venetta |
Hello Hyyan,
Thanks for the awesome plugin.
There is a problem with variable product attribute when creating the copy of the product variations for another language. The meta 'attribute_' is not synced. All the other metas are being copied except the main attribute.
I'm a new developer and as far as I've looked into it the problem seems to be in
File: src/Hyyan/WPI/product/variation.php
Function: protected function copyVariationMetas($from, $to){...}
the array $translated is always empty so the value is not getting copied. I'm not sure if that is the problem or I'm doing something wrong. Can you check that please?
Regards,
Akash Kanojia
The text was updated successfully, but these errors were encountered: