88b62a46fa
* Introduce the ProductUpdater class. * Update the image assignment for the default products content. * Update the default products content. * Introduce the generate_content and get_placeholder_products methods. * Update the get_placeholder_products method and introduce the new create_new_product method. * Verify the hash of the product content and compare it with the hash of the ai generated content to ensure we wont override products modified by the store owner. * Add docblocks and update the structure for the ProductUpdater class. * Pass the vertical images as a param for the PatternUpdater and the ProductUpdater. * Update the provided variable to the PatternUpdater class. * Update the ProductUpdater class to include the requirements for usage of the media_sideload_image method outside the wp-admin area (via API) and other adjustments to the products generation and hashes * remove unnecessary calls to post/product images. * Update the loop for generating products. * Further adjustments to the Product Updater. * Provide the business_description as a param for the generate_content ProductUpdates * Update the default timeout for the AI connection; update the path to the default image. Add a limit of 6 when quering the total products created by the store owner. * Add new neutral placeholder images for products and patterns. * Update the prompt and the logic for the placeholder images. * Remove placeholder images. * Pass the AI connection as a param and update the get_images_for_pattern method to rely on the results returned from the Pexels API. * update the product updater class to rely on Pexels images and add the ai_connection as a param. * Remove the unused get_random_images method. * Update the patterns endpoint. * Delete unused ChatGPTClient class. * Introduce the new Pexels class. * Remove the Verticals references. * Update the reference for the alt description for images. * Update the scheduled action to populate patterns and products. * Remove unused Verticals classes. * Ensure the Pexels class already returns the array with the expected format for assignment to Patterns and Products. * Introduce the select_image_src_based_on_format method. * Increase max execution time * Increase max execution time * Update the request to rely on the WP.com external-media endpoint instead. * Improve performance for product content update. * Improve quality of images used in products and update queries. * Update the products query. * Move the media_sideload_image function dependencies to outside of the loop and add comment. * Update text content. * Merge base branch * Introduce the should_update_dummy_product method. * Update the method to be triggered on scheduled action to return true. * Change the image format for products to improve performance. * Make portrait the default fallback image format. * Address code review. * bail early if no business description provided. * Add an extra safety check in case of query errors. * Address CR. * Raise the default memory limit. * Update the prompt for the search term for images. * Make sure the 'woocommerce_blocks_allow_ai_connection' option is set to true if the site is connected to AI. * Update the prompt for AI generated content in patterns and initialize the images and alts for the patterns. * Update the prompt for products and introduce the update_dummy_products method. * Update the default number of images returned by Pexels. * Update the default fallback for the expected image format. * Update the prompt for selecting the images. * Add a character limit to the testimonials. * Increase timeout to fetch products data * Address code review. |
||
---|---|---|
.. | ||
.github | ||
.husky | ||
.sources | ||
.vscode | ||
.wordpress-org | ||
assets | ||
bin | ||
docs | ||
images | ||
packages | ||
patches | ||
patterns | ||
src | ||
storybook | ||
templates | ||
tests | ||
.distignore | ||
.editorconfig | ||
.env | ||
.eslintignore | ||
.eslintrc.js | ||
.gitattributes | ||
.gitignore | ||
.markdownlint.json | ||
.markdownlintignore | ||
.nvmrc | ||
.prettierignore | ||
.prettierrc.js | ||
.stylelintrc.json | ||
.wp-env.json | ||
LICENSE | ||
README.md | ||
babel.config.js | ||
checkstyle.xml | ||
composer.json | ||
composer.lock | ||
docker-compose.yml | ||
global.d.ts | ||
package-lock.json | ||
package.json | ||
phpcs.xml | ||
phpunit.xml.dist | ||
postcss.config.js | ||
readme.txt | ||
tsconfig.base.json | ||
tsconfig.json | ||
webpack.config.js | ||
woocommerce-gutenberg-products-block.php | ||
wp-cli.yml |
README.md
WooCommerce Blocks
This is the feature plugin for WooCommerce + the Gutenberg. This plugin serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor.
Use this plugin if you want access to the bleeding edge of available blocks for WooCommerce. However, stable blocks are bundled into WooCommerce, and can be added from the "WooCommerce" section in the block inserter.
Table of Contents
- Documentation
- Installing the plugin version
- Installing the development version
- Getting started with block development
- Long-term vision
Documentation
To find out more about the blocks and how to use them, check out the documentation on WooCommerce.com.
If you want to see what we're working on for future versions, or want to help out, read on.
Code Documentation
- Blocks - Documentation for specific Blocks.
- Editor Components - Shared components used in WooCommerce blocks for the editor (Gutenberg) UI.
- WooCommerce Blocks Handbook - Documentation for designers and developers on how to extend or contribute to blocks, and how internal developers should handle new releases.
- WooCommerce Blocks Storybook - Contains a list and demo of components used in the plugin.
Installing the plugin version
We release a new version of WooCommerce Blocks onto WordPress.org every few weeks, which can be used as an easier way to preview the features.
Note: The plugin follows a policy of supporting the "L0" strategy for version support. What this means is that the plugin will require the most recent version of WordPress. It will also require the most recent version of WooCommerce core at the time of a release. You can read more about this policy here.
1.Ensure you have the latest available versions of WordPress and WooCommerce installed on your site. 2. The plugin version is available on WordPress.org. Download the plugin version here. 3. Activate the plugin.
Installing the development version
- Ensure you have the latest versions of WordPress and WooCommerce installed on your site.
- Get a copy of this plugin using the green "Clone or download" button on the right.
- Make sure you're using Node.js v16.15. If you use a Node version management tool such as
nvm
orn
, you can do so by runningnvm use
orn auto
, respectively. npm install
to install the dependencies.composer install
to install core dependencies.- To compile the code, run any of the following commands
npm run build
(production build).npm run dev
(development build).npm start
(development build + watching for changes).
- Activate the plugin.
The source code is in the assets/
folder, and the compiled code is stored into build/
.
Getting started with block development
Run through the "Writing Your First Block Type" tutorial for a quick course in block-building.
For deeper dive, try looking at the core blocks code, or see what components are available.
To begin contributing to the WooCommerce Blocks plugin, see our getting started guide and developer handbook.
Other useful docs to explore:
Long-term vision
WooCommerce Blocks are the easiest, most flexible way to build your store's user interface and showcase your products.