-
Notifications
You must be signed in to change notification settings - Fork 67
WooCommerce 3.6 issues #408
Comments
Hello. Here is a bug related to what you mention above. Can you reproduce this issue on default Wordpress theme (eg Storefront)? Can you reproduce this issue when all other plugins are disabled except WooCommerce, Polylang and Hyyan WooCommerce Polylang Integration? What product versions and settings are you using when this issue occurs? Steps to Reproduce What I Expected What Happened Instead |
Product Type is Confirmed 3.6.x issue - I can also reproduce this and is also reported on https://wordpress.org/support/topic/variable-products-change-to-simple-in-translated-version/ The product type issue is likely caused by the caching added to product type woocommerce/woocommerce@57ccde6 This is a different but similar issue to the new Product Data Lookup Tables: essentially all updates now need to go through the woocommerce api to ensure the caching and lookup tables are updated. |
I don't have much experience dealing with WooCommerce code, but is there any info on the WooCommerce caching somewhere so we can try to find a way to fix these issues? According to your findings, does the
|
Ideally, all the updates should use the woocommerce Product objects rather than the wordpress Post objects, to ensure any woocommerce level caching and intermediate tables (and future Product tables) are always consistent. This may not be as difficult as it sounds. Alternatively it should also be possible to update as is and force woocommerce to re-cache and recalculate the relevant objects, but updating through the api would be more future-proof, and we could all do with less maintenance and fewer issues from future woocommerce releases. The info on the changes is all there in the first link in this thread and release notes of the point versions since then. The woocommerce github link above I found by looking through the release notes which are linked to github fixes. |
In really old versions of the plugin, there was a call to |
@mrleemon yep that fixes the variation product type issue, well done! It is a bit of hack job - it doesn't actually correct the underlying problem but instead uses a bit of javascript to synchronise the translated new product form with a bit of woopoly meta, so that it works fine when the product is saved. The general product synchronisation seems to be ok too (subject to more testing), only the new wc_product_meta_lookup table is not updated and I believe that currently only affects sorting. |
So, we need to directly copy product properties using WooCommerce CRUD functions instead of relying on the |
Well the meta itself seems to be working, just there is a risk that it could be cached for example here is the woocommerce caching added for variation attributes :
Somehow I think the cache is getting cleared and this is working, that may be luck rather than design. |
I don't know if the following WC function can be useful to copy product data when creating new translations: It uses a |
@mrleemon thanks.. we don't duplicate the product like that but perhaps we could.....? In the meantime I do have another solution which I will check in. |
@mrleemon I accepted your suggestion for $this->syncSelectedproductType($ID); and added a function to ensure that translation product caches are cleared and that the lookup tables are updated. This addresses all 3.6 issues reported so far. |
Yes, I know. But, probably in the long run it will be necessary to consider duplicating products using WC core functions, given that the WC team plans to move all product metadata out of the wp_postmeta table in the future. |
The new product post is created by Polylang as a blank post with taxonomy data for language and linked translations and selected meta and this plugin extends that in a generic way to handle meta options and additional terms and taxonomies. It's actually better that the terms and taxonomies are copied in a generic way because then they (generally) work (or can be made to work with filters) on any product type (including product types we don't know about) and any plugin that adds meta data or taxonomies to the product (which the standard woocommerce objects do not know about). WooCommerce long term goal seemed to be to move the product data from the posts table itself, but that breaks every extension plugin so that's why they've come up with this lookup table to mitigate the performance limitations for the main data fields used for sorting. |
merged in updates from 3.6.3 WooCommerce cart-fragments.js
woocommmerce pull request 23820 currently labelled for 3.7.0 milestone should make update_lookup_table() public in future. This checking handles that by upgrading itself to use update_lookup_table() if the functionality is available.
Hi! Has this bug been fixed? Last changelog entries mention that compatibility with WC 3.6 has been fixed, but this issue is still open. What is the status? Also, is it possible to have the plugin distributed by WP (https://wordpress.org/plugins/woo-poly-integration/) updated? BTW, loads of thanks for maintaining this plugin to all involved people! |
This is a general topic for woo3.6 issues not referring to a single issue. Specific issues reported so far were fixed from the first 3.4 release of this plugin on github. The source is now 3.4.3 which I will release on github after rechecking a few more points. It is always preferable to have more feedback from early adopters before a full release on WordPress: there are so many different settings and usage scenarios that full testing is actually impossible especially when other plugins are considered - I already had to revert one change after accepting it because a compatibility change for the benefit of one plugin broke compatibility for other plugins (name your price vs currency switchers). Yesterday WooCommerce rejected one of my related pull requests to WooCommerce 3.6+ after previously accepting it - on consideration they don't want to allow other plugins to able resynchronise the product lookup table - so in the long term any wordpress plugin that treats product as a post using the WordPress API will have issues. At the same time the only reliable way so far of copying product data for any product (including custom product types which have data we do not know about) is to copy all the meta and taxonomy data that there is (according to settings and filterable of course). |
I am still experiencing this bug on Hyyan WooCommerce Polylang Integration Version 1.4.3 on wp5.2.2 Loading the editor for a variable product removes the variable product data, even re-saving the variable product data is ineffective. Disabling and re-enabling Hyyan did not change this behaviour |
Hi, @Oclair please note that the fix is still working even with the latest Polylang and WooCommerce updates, so if you are experiencing a problem please raise as a separate github issue with full details. Please note that the workaround does include javascript so in addition for checking for server side errors, it is worth Inspecting with Chrome developer tools and checking the javascript console for any errors. It is possible that another problem or other plugin is affecting this in some way. |
Hey thanks for the response and solution, not a trivial caveat enabling javascript! Thanks again, have a nice one!
|
I actually removed this workaround a few versions ago as I don't like it and found it was not necessary. Unfortunately WooCommerce changes made it necessary again and I couldn't find a better alternative.. |
Opening this ticket for potential WooCommerce 3.6 compatibility issues.
See the post for enhancements in 3.6:
https://woocommerce.wordpress.com/2019/04/01/performance-improvements-in-3-6/
The extensive changes are likely to introduce some subtle bugs.
For example Product Meta synchronisation uses the standard Polylang post meta synchronisation, it does not use the Product api, so updated meta for secondary languages would not be copied to the new woo3.6 product lookup tables which might create subtle bugs on product sorting and reports when not using site primary language.
Similarly, cached product data for secondary languages may not be flushed on updating product in primary language.
The text was updated successfully, but these errors were encountered: