Skip to content

Conversation

@kmanijak
Copy link
Contributor

Submission Review Guidelines:

Changes proposed in this Pull Request:

Classic Product Grid was limited to use in Product Archive templates. Newer product grid blocks (Products (Beta) or experimental Product Collection from WooCommerce Blocks) can be added outside of the product archive like to a post or a page.

When you add a product to the cart in Products block, there's "View Cart" link appearing below. When Products or Product Collection block is used in another place than an archive template (post/page) then "View Cart" link is off.

This is because some of the styles are not applied, since they require .woocommerce class in their ancestor, which is added to the body element of product archive, but not on the page or post.

This PR moves the a.added_to_cart selector from .woocommerce.

Closes woocommerce/woocommerce-blocks#9999.

How to test the changes in this Pull Request:

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

  1. Activate a block theme (e.g. TT2 or TT3)
  2. Create new post
  3. Add Products (Beta) block
  4. Publish the post and go to the frontend
  5. Add a product to cart
  6. Expected: "View Cart" link appears BELOW the "Add to Cart" button

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jun 27, 2023
@kmanijak kmanijak changed the title Fix/products grid layout in post Fix "View Cart" link layout in post/page Jun 27, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 2023

Test Results Summary

Commit SHA: 77dfa4a

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202611m 9s
E2E Tests1900018020813m 6s

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.

@kmanijak kmanijak requested a review from Aljullu June 27, 2023 11:59
@github-actions
Copy link
Contributor

Hi @Aljullu,

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.

Works great and code looks good, thanks @kmanijak! 🚀

@kmanijak kmanijak merged commit b5cbc1d into trunk Jun 28, 2023
@kmanijak kmanijak deleted the fix/products-grid-layout-in-post branch June 28, 2023 06:46
@github-actions github-actions bot added this to the 8.0.0 milestone Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"View Cart" is off when Products/Product Collection blocks are used in post/page

3 participants