woocommerce/plugins
Manish Menaria 1ed5d0872a
Fix: Enable Pagination Block Visibility in Product Collection Block (#43132)
* Fix: Enable Pagination Block Visibility in Product Collection Block

This commit resolves an issue where the Pagination block was not visible in the block insertor within the Product Collection block.

- The core query pagination block name, initially hardcoded, is now declared as a constant `coreQueryPaginationBlockName` in `constants.ts`. This change not only improves code readability but also ensures consistency in using the block name across different files.

- In `index.tsx`, the `addProductCollectionBlockToParentOfPaginationBlock` utility function from `utils.tsx` is imported and executed. This function plays a crucial role in the fix. It dynamically adds the Product Collection block to the parent array of the Core Pagination block, ensuring the latter's visibility in the insertor when editing the Product Collection block.

- The utility function employs WordPress hooks and version checks to gracefully handle different WordPress environments. This careful approach maintains backward compatibility while addressing the current issue.

With these changes, merchants can now easily add a Pagination block from the insertor while working on the Product Collection block, enhancing the user experience and functionality.

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-29 15:45:29 +05:30
..
woo-ai Add React Testing Library to the Woo AI plugin. (#42993) 2023-12-21 12:25:08 +01:00
woocommerce Fix: Enable Pagination Block Visibility in Product Collection Block (#43132) 2023-12-29 15:45:29 +05:30
woocommerce-admin Update tracks events hooks for HPOS (#42879) 2023-12-29 08:46:59 +00:00
woocommerce-beta-tester Updated PNPM to ^8.12.1 (#42860) 2023-12-18 20:31:49 +13:00
woocommerce-blocks Fix: Enable Pagination Block Visibility in Product Collection Block (#43132) 2023-12-29 15:45:29 +05:30
woocommerce-docs Fixed WooCommerce Docs Build Errors (#42000) 2023-12-10 22:39:00 -08:00