Skip to content

Conversation

@mattsherman
Copy link
Contributor

@mattsherman mattsherman commented May 18, 2023

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR fixes the confirmation shown when removing an attribute from a product.

Previously, when removing an attribute from a Simple product, the confirmation message would make mention of "variations".

Before

Screenshot 2023-05-18 at 16 37 53

After

Screenshot 2023-05-18 at 16 48 13

How to test the changes in this Pull Request:

With a Simple product

  1. Click "Remove" on an attribute on a Simple product.
  2. Verify the confirmation message does not mention "variations".

With a Variable product

  1. Click "Remove" on an attribute with the "Used for variations" checkbox checked.
  2. Verify the confirmation message mentions "variations".
  3. Click "Remove" on an attribute with the "Used for variations" checkbox unchecked.
  4. Verify the confirmation message does not mention "variations".

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label May 18, 2023
@mattsherman mattsherman changed the title Fix/remove product attribute message Show correct confirmation message when removing an attribute from a product May 18, 2023
@mattsherman mattsherman self-assigned this May 18, 2023
@mattsherman mattsherman requested a review from a team May 18, 2023 20:58
@github-actions
Copy link
Contributor

github-actions bot commented May 18, 2023

Hi @nathanss, @woocommerce/mothra-enhancements

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@mattsherman mattsherman marked this pull request as ready for review May 18, 2023 20:58
@github-actions
Copy link
Contributor

Test Results Summary

Commit SHA: 8b3bc7f

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests26700202691m 1s
E2E Tests1890010019918m 11s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@nathanss nathanss self-requested a review May 19, 2023 12:21
Copy link
Contributor

@nathanss nathanss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! Code is simple and works as intended.

It is very confusing that the checkbox actually is checked but invisible when it's not a variable product... I had to handle this in the tracks events as well...

@mattsherman mattsherman merged commit 2992e22 into trunk May 19, 2023
@mattsherman mattsherman deleted the fix/remove-product-attribute-message branch May 19, 2023 12:27
@github-actions github-actions bot added this to the 7.8.0 milestone May 19, 2023
@jarekmorawski
Copy link

Thanks for spotting this, @mattsherman. Later on, we can try not to have any notice because a regular attribute is something the user can easily add back in without losing important product data.

It is very confusing that the checkbox actually is checked but invisible when it's not a variable product... I had to handle this in the tracks events as well...

What checkbox do you mean, @nathanss? Anything we can fix or simplify?

@mattsherman
Copy link
Contributor Author

Thanks for spotting this, @mattsherman. Later on, we can try not to have any notice because a regular attribute is something the user can easily add back in without losing important product data.

💯 Good idea... I'll spin up a quick PR later to take care of this... will be just as much time as creating an issue for us to track. 😄

It is very confusing that the checkbox actually is checked but invisible when it's not a variable product... I had to handle this in the tracks events as well...

What checkbox do you mean, @nathanss? Anything we can fix or simplify?

It's the "Used for variations" checkbox. It isn't visible to the user when not a variable product, but it's still there in the DOM. Would be something to consider cleaning up in the future, but it won't have any affect on the UX. Well, not strictly true... because I believe since it is checked right now, even when hidden, that any attributes created while a simple product will default to "Used for variations" when the product is later converted to a variable product.

@jarekmorawski
Copy link

since it is checked right now, even when hidden, that any attributes created while a simple product will default to "Used for variations" when the product is later converted to a variable product.

🤯 We should definitely clean this up one day. Imho the attribute props should clear once it's removed. Even in the new UX, it will make sense to not leave the box on when the user moves a global attribute from Attributes to Variation options.

@mattsherman
Copy link
Contributor Author

Thanks for spotting this, @mattsherman. Later on, we can try not to have any notice because a regular attribute is something the user can easily add back in without losing important product data.

@jarekmorawski This is addressed in #38386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug The issue is a confirmed bug. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants