Skip to content
This repository was archived by the owner on Mar 17, 2022. It is now read-only.
This repository was archived by the owner on Mar 17, 2022. It is now read-only.

When creating new variable translation, variations not visible until save #534

@Jon007

Description

@Jon007

commented by @charalampospapadop on #430
"Seems to work fine the only thing is that when i translate the product first time before i publish it , it does not show the variable products, then i publish it but they still wont show, i had to do 1 extra update after the publish, then they showed up. Thanks again."

Root cause is that get_children() no longer works when in new translation because Polylang adds filter for language taxonomy in wp_term_relationships
even though a left join, because the where clause does not allow for no value, items with no taxonomy are filtered out, example WP_Query sql:

SELECT   wp_posts.* FROM wp_posts  
LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND wp_posts.post_parent = 644  
 AND ( 
  wp_term_relationships.term_taxonomy_id IN (173)
) 
AND wp_posts.post_type = 'product_variation' AND ((wp_posts.post_status <> 'trash' AND wp_posts.post_status <> 'auto-draft')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC 

on publishing the new translation, the hyyan synchronisation process re-synchronises so everything is resolved on refresh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions