Backport fix for missing product type dropdown in WP #335
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
When Classic Commerce is used on WordPress 5.5+ the product type dropdown is missing. This is a known issue and was fixed in WooCommerce 4.3.2. There has been interest shown by some users in testing CC on WordPress before making a commitment to switch to ClassicPress. so it may be worth trying to backport this change into CC.
As far as I can tell, a function was added in class-wc-admin.php to check the WP version and apply an extra css class if necessary.
There is a condition added to meta-boxes-product.js to add this in, and some new css rules to handle the display.
NB. The current admin.css file is minimised so I have placed the new css at the end of the file. This is enough to get the dropdown to display, but it it still in the wrong place and this file needs more work.
Partially addresses #331 .
How to test the changes in this Pull Request:
Screenshot - before:
Screenshot - after:
Other information:
NB The new function in class-wc-admin.php only tests for WP version. I don't know what happens with CP and whether this test may cause problems later with higher CP versions. It might be worth adding a condition specifically to cater for CP sites (?).