Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

TT4: Sales badge (on empty cart block) is misaligned #11058

Closed
nielslange opened this issue Sep 27, 2023 · 2 comments · Fixed by #11182
Closed

TT4: Sales badge (on empty cart block) is misaligned #11058

nielslange opened this issue Sep 27, 2023 · 2 comments · Fixed by #11182
Assignees
Labels
block: newest products Issues related to the Newest Products block. type: bug The issue/PR concerns a confirmed bug.

Comments

@nielslange
Copy link
Member

nielslange commented Sep 27, 2023

Describe the bug

When using WordPress 6.4 and the Twenty Twenty-Four theme, the sales badge is misaligned on the empty cart block.

As the empty cart block is using the Newest Products block, this issue needs to be addressed in the Newest Products block rather than within the Cart block.

cc: @woocommerce/woo-fse

To reproduce

Steps to reproduce the behavior:

  1. Install WordPress 6.4 Beta 1.
  2. Create a test page and add the Cart block to it.
  3. Ensure that at least one product with a sales price is available.
  4. Go to the frontend and open the test page with the Cart block, without adding a product to the cart.
  5. Verify that the sales badge is misaligned and appears next to the product image.

Note
To display only the product with a sales price in the empty cart block, set the status of all other products to draft. This ensures that only the product with a sales price is visible.

Expected behavior

The sales badge should appear in the upper-right corner of the product image.

Screenshots

Screenshot 2023-09-27 at 12 15 35
@nielslange nielslange added type: bug The issue/PR concerns a confirmed bug. block: newest products Issues related to the Newest Products block. theme: Twenty Twenty-Four labels Sep 27, 2023
@nielslange nielslange self-assigned this Oct 9, 2023
@nielslange
Copy link
Member Author

While the Twenty Twenty-Three theme sets .alignwide to 1200px, which renders the product images in a width of 450px, the Twenty Twenty-Four theme sets .alignwide to 1280px rendering the product images in a width of 300px. This leads to gaps between the product images and causes the sales badge to be visible next to the product image instead of within it.

In p1696841688418399-slack-C02UBB1EPEF, @gigitux and @kmanijak suggested using the Product Collection block instead of the Newest Products block, which is showing the issue. Apart from addressing the initial issue, and alternative approach would be to increase the number of visible products, when the cart is empty, from three to four. This reduces the gap between the product images, resulting in the sales badge showing as expected. As the Product Collection block is still in beta, and we would rather not relocate resources to the Newest Products block, given that this block might be deprecated in the future. In pca54o-6sH-p2#comment-5830, @pmcpinto and I agreed on increasing the number of visible products. This change will only affect new installations, but not existing stores.

cc: @ralucaStan

@nielslange
Copy link
Member Author

Fixed by #11182

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: newest products Issues related to the Newest Products block. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant