Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport fix for missing product type dropdown in WP #335

Merged
merged 3 commits into from Oct 18, 2021
Merged

Backport fix for missing product type dropdown in WP #335

merged 3 commits into from Oct 18, 2021

Conversation

ghost
Copy link

@ghost ghost commented Sep 2, 2021

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:

  1. On a test site running a recent WP version and CC, copy in the revised files:
  • assets/css/admin.scss
  • assets/js/admin/meta-boxes-product.js
  • includes/admin/class-wc-admin.php
  1. Create a new product and test the various options for product type using the dropdown.
  2. Do the same on a site running CP and CC and make sure everything still works normally.

Screenshot - before:

before

Screenshot - after:

product-data-wp

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 (?).

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?
  • Have you included screenshots before/after your changes, if applicable?

assets/css/admin.css Outdated Show resolved Hide resolved
@ClassyBot
Copy link

This pull request has been mentioned on ClassicPress Forums. There might be relevant details there:

https://forums.classicpress.net/t/classiccommerce-missing-product-data-dropdown/3426/24

@bahiirwa
Copy link
Collaborator

Would you mind pulling this down and testing @simplycomputing ?

@ghost
Copy link
Author

ghost commented Sep 25, 2021

Will do (once I work out how to do that).

@bahiirwa
Copy link
Collaborator

Will do (once I work out how to do that).

Using your git tool, go checkout to this branch if you still have it on local. Then pull from upstream.

@ghost
Copy link
Author

ghost commented Sep 25, 2021

Yes! Looks good. All the dropdown options work and it is in the right place. Nice job!
fixed

@ghost ghost added the enhancement New feature or request label Sep 27, 2021
@ghost
Copy link
Author

ghost commented Oct 18, 2021

.

@ghost ghost closed this Oct 18, 2021
@nylen nylen reopened this Oct 18, 2021
@nylen nylen merged commit 45ae77c into ClassicPress:master Oct 18, 2021
@ClassyBot
Copy link

This pull request has been mentioned on ClassicPress Forums. There might be relevant details there:

https://forums.classicpress.net/t/classiccommerce-v2/4860/33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants