Closed mrleemon closed 3 years ago
Instead of modifying the addFieldsLocker()
function, I think that the following line in the syncProductsMeta()
function should be updated to reflect the case I'm talking about:
Maybe change it to this:
$disable = $ID && ( pll_get_post_language($ID) != pll_default_language() ) && pll_get_post( $ID, pll_default_language() );
I tried this in one of my sites, and it's working apparently. I can open a PR if you want.
Hi, In the way this plugin works for variable products, the secondary language variations are always overwritten from the primary language, the primary language must be created first. If not I think anything previously created in a secondary language would be wiped out as soon as you start drafting a translation in the primary language. So creating variable products in secondary language could lead to 'unexpected behaviour' hence discouraged... Fields Locker is optional feature so can also just be turned off when it is necessary to do something special in a secondary language.
Can you reproduce this issue on default Wordpress theme (eg Storefront)?
Yes
Can you reproduce this issue when all other plugins are disabled except WooCommerce, Polylang and Hyyan WooCommerce Polylang Integration?
Yes
What product versions and settings are you using when this issue occurs?
Steps to Reproduce
What I Expected
The product fields should be able to be edited/selected/checked.
What Happened Instead
The product fields are locked and cannot be edited/selected/checked.
It seems that the Fields Locker script is always active when editing products in a secondary language even if there is no product in the default language to synchronize to. This is a fringe case, as usually one adds products in the default language first and then adds its translations. But, I think that the
addFieldsLocker()
function in theMeta.php
file should check this.https://github.com/hyyan/woo-poly-integration/blob/139469117798fc87a14863eb71c7c64ded49487f/src/Hyyan/WPI/Product/Meta.php#L724