Display WooCommerce blocks in the Block Editor
The 'Product grid' block should appear in your list of available blocks.
If testing this repo locally, run NPM and Composer to set up the plugin.
npm install
composer install
A wp-env
config is included for spinning up a WordPress instance. WooCommerce and WooCommerce Smooth Generator come installed and activated with this config.
After running npm install
, the wp-env
instance can be set up by running
wp-env start
Your WordPress instance will then be available at localhost:8888
with the default login credentials of admin
and password
.
Products can be generated by using the command
wp-env run cli "wp wc generate products <nr of products>"
The wp-env
instance can be stopped by running:
wp-env stop
Further information about using wp-env and wc-smooth-generator can be found in their documentation.
This plugin offers a basic way of displaying WooCommerce products on any location that accepts blocks.
- customisable product metadata - users should be able to control which elements appear with each product: image, title, description, price (with tax), price (without tax), stock levels and so on. Text size and colour should also be customisable.
- theme.json support - extra customisation should be configurable via theme.json. Default values such as the number of posts to display and rows should be customisable at a theme level.
- filtering - users should be able to filter the products they display by category, tag or free text search.
- test coverage - Puppeteer coverage and unit tests across the JavaScript code base.
- running tests on the repo - our test suite should run against any PR and build. This ensures any changes to the plugin do not break existing functionality. The test suite should also run against older versions of WordPress, WooCommerce and PHP for maximum compatibility.
- uninstall process - when the plugin is removed, the plugin's data should be removed. This includes any blocks currently in use.