ClassicPress / classic-commerce

A simple but powerful e-commerce platform built for ClassicPress. Forked from WooCommerce and compatible with many Woo extensions.
https://classiccommerce.cc/
GNU General Public License v3.0
50 stars 15 forks source link

Backport fix for missing product type dropdown in WP #335

Closed ghost closed 2 years ago

ghost commented 2 years ago

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
  2. Create a new product and test the various options for product type using the dropdown.
  3. 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 (?).

ClassyBot commented 2 years ago

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 commented 2 years ago

Would you mind pulling this down and testing @simplycomputing ?

ghost commented 2 years ago

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

bahiirwa commented 2 years ago

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 commented 2 years ago

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

ghost commented 2 years ago

.

ClassyBot commented 11 months ago

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

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