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

Hide sale badge if product image is disabled #43334

Merged
merged 5 commits into from Jan 5, 2024

Conversation

roykho
Copy link
Member

@roykho roykho commented Jan 5, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR fixes an issue with the on-sale badge covering the product title when product image is disabled.

For reference the woocommerce/woocommerce-blocks#10297 that introduced this issue.

Before After
file.png file.png

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Add the following blocks to a post/page. Hand-picked Products, Best Selling Products, Products by Category, Newest Products, On Sale Products, Products by Attribute, Products by Tag, Top Rated Products.
  2. For each of these blocks, ensure the Sale badge is on the top right of the product image.
  3. Now turn off Product Image in the inspector controls. Ensure the Sale badge is now hidden.
  4. Save the post/page and ensure it shows the same in the frontend.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message Fix on-sale badge covering product title when product image is disabled

Comment

@roykho roykho added type: bug The issue is a confirmed bug. team: Kirigami & Origami block: on sale products Issues related to the On Sale Products block. labels Jan 5, 2024
@roykho roykho self-assigned this Jan 5, 2024
@woocommercebot woocommercebot requested review from a team and imanish003 and removed request for a team January 5, 2024 16:34
@roykho roykho requested a review from Aljullu January 5, 2024 16:34
Copy link
Contributor

github-actions bot commented Jan 5, 2024

Hi @Aljullu, @imanish003,

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

Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

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

It looks good, but I wonder if we could hide it from the PHP side, instead of from CSS. I just took a look and I think we would only need to modify this line? 🤔

if ( empty( $this->attributes['contentVisibility']['price'] ) ) {

What do you think?

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jan 5, 2024
@roykho
Copy link
Member Author

roykho commented Jan 5, 2024

@Aljullu good idea, done!

Copy link
Contributor

github-actions bot commented Jan 5, 2024

Test Results Summary

Commit SHA: 8b1a5f4

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 37s
E2E Tests258003026113m 33s

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.

Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for handling that, @roykho!

Copy link
Contributor

@thealexandrelara thealexandrelara left a comment

Choose a reason for hiding this comment

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

Ohh nice catch! Thank you for working on this, Roy! ✅

@roykho roykho merged commit 6ef04ba into trunk Jan 5, 2024
29 checks passed
@roykho roykho deleted the fix/on-sale-badge-with-no-image branch January 5, 2024 19:16
@github-actions github-actions bot added this to the 8.6.0 milestone Jan 5, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Jan 5, 2024
@rodelgc rodelgc added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block: on sale products Issues related to the On Sale Products block. needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris team: Kirigami & Origami type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants