* Run E2E test suite on Twenty Twenty-Four
* Update TT4 download URL to the stable one
---------
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
This commit introduces the `get_block_type_style` method in the `ProductCollectionNoResults` class. This new method is designed to manage frontend style handling specifically for this block type. Currently, it returns null, indicating no specific styles are assigned at this stage.
* Update Interactivity API JS files
* Disable TS checks in the Interactivity API for now
* Add new SSR files
* Replace wp_ prefixes with wc_ ones
* Replace wp- prefix with wc-
* Replace guternberg_ prefix with woocommerce_
* Remove file comments from Gutenberg
* Rename files with `wp` prefix
* Fix code to load Interactivity API php files
* Remove TODO comments
* Replace @wordpress with @woocommerce
* Update Webpack configuration
* Fix directive prefix
* Remove interactivity folder from tsconfig exclude
* Add client-side navigation meta tag code
* Remove unneeded blocks.php file
* Fix store tag id
* Register Interactivity API runtime script
* Fix Interactivity API runtime registering
* Add Simple Price Filter block
* Remove all files related to directive processing in PHP
* Use values directly for SimplePriceFilter SSR
* Reset pages to 0 when changing filter
Note: we also need to do this with `/page/x`
* wip
* phpcs
* register price filter as inner block
* try: render block using save
* add types
* use min range var instead of 0
* inject dynamic data
* query price data in editor
* better injecting interactivity data
* remove rounding
* Product Collection Data endpoint doesn't care about current query so we remove the context for now
* extract data injecting as a method, possbily a trait in the future
* add sidebar setting
* duplicating the markup in php render callback for safety
* remove directive from edit component
* show prices without decimal
* use final class
* use sample collection data response
* prepare for multiple styles support
* use collection data from context
* cleanup props and props passing
* pass only necessary states
* retire heredoc in favor of late escaping
* reorganize style
* inherit style from current price filter react component, pre extract the component for multiple display style support
* keep minPrice smaller than max
* remove unnecessary active handler logic
* update folder structure
* avoid whitespace change
* clean up
* title
* move inspector to component folder, ready to be extracted to inner block
* block icon
* block name
* name
* use inner block for view
* inner block view switcher
* try: process data in Collection Filtes block only
* wip: query collection data from collection filters block only
* provide all context from collection filters block
* simplify context passing
* feat: use default attribute to define filter type of view block
* rename
* remove price block
* rename price slider to price, default price filter should be a slider
* type cleanup
* fix ancestor block name
* only passing the collection data down
* wip
* recusive
* editor preview
* refactor: data fetching, context passing, and code organization
* initial attribute filter block
* feat: attribute selector
* inspector control
* wip
* break the edit into smaller components
* wip: editor component
* extract checkbox list
* wip editor preview
* show count checkbox list
* fix param aggregation for attribute filter blocks
* post merge fix
* fix param aggregation for attribute filters
* fix: set correct selected attribute
* WIP checkbox list
* WIP checkbox list
* avoid action name conflicts
* Checkbox list front end
* phpcs
* update context on input, navigate on change
* fix: attribute selection
* dropdown
* remove isDeepEqual
* add: warning when attribute has no products or no attribute is selected
* update type
* update type
---------
Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
* Fine-tune the prompts for generating product titles.
* Update the prompt for images.
* Update the prompts for generating content for patterns.
* Break down the pattern content generation into individual methods.
* Add character limit to prompts.
* Add character limit for a handful of titles.
* Add character limit to the title of the product-collection-4-columns pattern.
* Update the prompt to not add abbreviations
* Introduce the refine_returned_images_results method for AI to filter the images returned by Pexels
* Implement retry if the number of images returned by Pexels API is smaller than the number of images required by products and patterns.
* Update the prompt for the images search term.
* Fix AI image assignment for newly created products and improve performance.
* Ensure no additional dummy products are created or updated in simultaneous requests.
* Fix error on generating content for patterns for the first time and saving it to the post.
* Return error if the connection with AI failed.
* Update the prompt character limit for the Featured Category Triple pattern.
* Implement retry if the API connection with AI fails. Update the prompt to remove the length instruction. Add the last_business_description check to prevent duplicated API calls. Set a transient for images in case the request fails.
* Add retry for returning the refined search results. Update the prompt for defining the search term. Update error validation.
* Update the structure for fetching patterns content and reduce the number of requests.
* Break down the pattern ai content generation and assignment into multiple methods and introduce retry in case of failure.
* Update the structure for applying the AI generated content to patterns. Update the fetch and validation of ai responses and update the prompt to ensure longer texts are returned.
* Update the validation of the content returned by AI by verifying the array keys and ensuring the values are not empty. Additionally, the completion should be set.
* If for some reason AI didn't return the complete list of expected generated content, use the same the previous text from the same pattern as a replacement and avoid making an extra request to fetch just fetch a possible missing result.
* Update prompts for patterns.
* Make a single request to fetch all products data, implement retry for products and validation for the response returned by AI.
* Update the retries variable first within the patterns loop.
* Narrow down the AI content generation to only patterns that are part of the Assembler.
* Update the size of images and the prompt for AI generated content assigned to products.
* Don't make request to AI if the user provided a single word for their business description.
* Update the image assignment to products and remove the unused update_dummy_products method.
* Update the prompt for generating content for patterns.
* Update the prompt for products content generation and ensure that an error is returned if all requests fail.
* Update the prompt for patterns.
* Update the prompt for images.
* Update the prompt for images.
* Update prompt for button text.
* Don't schedule action for updating patterns content if the business description wasn't updated.
* add associative option when the local json is parsed
* Ensure the expected list of results matches the number or products to be updated.
* fix lint error
* Address CR.
---------
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* Add custom 'No Results' block for Product Collection
This commit introduces a new 'No Results' block, replacing the default core 'query-no-results' block within product collection block. The 'No Results' block provides a tailored experience for WooCommerce stores, displaying a custom message when no products are found in a query.
Key changes include:
- A new block type 'woocommerce/no-results' is registered with a complete configuration and content structure.
- Edit and save functions are implemented for the block, allowing for custom content and styles within the block editor and on the front end.
- Webpack entries are updated to include the new block in the build process.
- A PHP class NoResults is added for server-side rendering, which only displays the block when the product query returns no results, enhancing performance.
- The ProductCollectionUtils utility class is extended to support the new block's query needs.
The new block enriches the user experience by providing clearer communication when no products match the collection criteria and allows store owners to customize the message and presentation.
* Update description
* Rename 'no-results' block to 'product-collection-no-results'
Changes include:
- Updating the block name in `edit.tsx` within the `product-collection` directory.
- Modifying the block.json file in the `no-results` inner block to reflect the new name.
- Adjusting the className in `edit.tsx` for the `no-results` inner block.
- Altering the webpack entries in `webpack-entries.js` to recognize the new block name.
- Renaming the block in `NoResults.php` to align with this update.
This renaming aims to make the block's purpose more clear and to maintain a consistent naming scheme within our product collection blocks.
* Rename NoResults to ProductCollectionNoResults for clarity
This commit renames the `NoResults` class to `ProductCollectionNoResults`. The change aims to enhance clarity and specificity about the class's purpose, indicating that it specifically handles no-result scenarios within product collections.
Changes made:
- Renamed `NoResults.php` to `ProductCollectionNoResults.php`.
- Updated the class name from `NoResults` to `ProductCollectionNoResults` in the file.
- Modified the reference in `BlockTypesController.php` to use the new class name.
This renaming ensures better readability and understanding of the class's role in the context of product collections. The primary change is the renaming, with no significant alterations in the class functionality.
* Update No-Results Message Formatting in Product Collection Block
This commit simplifies the layout and message content for the 'No results found' message in the product collection block's no-results edit component. The changes include:
1. Removal of the full stop in the 'No results found' string for consistency.
2. Replacing the 'core/group' block with a 'core/paragraph' block.
3. Streamlining the message content to be more concise and integrated into fewer text blocks.
4. Direct links for 'clearing any filters' and navigating to the 'store's home' are now included in the same paragraph.
---------
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Fix strings in modal window
* Update assets/js/editor-components/incompatible-extension-notice/modal.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
---------
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Update smoke testing docs to mention the Product Collection block instead of the Products block
* Mention that Cart and Checkout blocks need to be added to the template instead of the pages
* Update docs/internal-developers/testing/smoke-testing.md
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
---------
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
* WIP: experimenting with strategy pattern for block registration
* Add TemplateChangeDetector to BlocksRegistrationManager
* Handle blocks registration
* Fix issue causing blocks to be registered multiple times
* Allow register/unregister blocks when on pages or posts
* Add BlockRegistrationStrategy logic
* Fix import error
* Add doc comments for BlockRegistrationManager class
* Add doc comments to TemplateChangeDetector class
* Fix eslint errors
* Import domReady from @wordpress/dom-ready
* Prevent error when using blockName for registerBlockType function
* Add e2e tests to check for block availability in different contexts
* Add e2e tests to cover block availability on different contexts
* Hide pager in dialog
* Product Gallery: reset main image when dialog closes
* Product Gallery block: Add product title to dialog
* Align double arrow
* Use H2 to be more semantic
* Use product title block in template part
* Default pager to off
* Remove pager only in dialog
* Remove unused param
* Default pager to off instead of removing
* Adds a state example for the payment data store
* Update docs/third-party-developers/extensibility/data-store/payment.md
Co-authored-by: Niels Lange <info@nielslange.de>
* Update docs/third-party-developers/extensibility/data-store/payment.md
Co-authored-by: Niels Lange <info@nielslange.de>
* Update docs/third-party-developers/extensibility/data-store/payment.md
Co-authored-by: Niels Lange <info@nielslange.de>
* Full stop
---------
Co-authored-by: Niels Lange <info@nielslange.de>
* Move Button, StoreNotice and StoreNoticesContainer components into the components package
* Delete the button folder and leave alias in index.ts
* Update references from @woocommerce/blocks-checkout to @woocommerce/blocks-components
* Load content and images on registration if the patterns is in the dictionary
* Stop getting the content from each pattern
* Add comment with explanation about the change
* Add checks to see if getCartData finished before rendering address
* Prevent block error due to excessive updates of customValidation
* Do not condense address in admin and handle phone field
* Add missing showPhoneField for billing
---------
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Create Related Products pattern reused in the Single Product template
That's needed in order to make the Related Products string translatable
* Add margin to Related Products heading
* Add margin to Related Products transformed from classic template
* Simplify the translation
* Change string capitalization so it's the same as the other one and can be transklated
* Fix attempts to count possible non-countable variables or usage of undefined variables
This fixes a few miscellaneous small problems where a possibly undefined variable was attempted to be accessed or a variable that wasn't necessarily countable was passed to `count()`
These were found by running Rector with rules specific to finding issues with php8.
* Fixing lint spacing issue
* Use wp_post table instead wp_option to store patterns data generated by AI
* avoid crash when there isn't any patterns_ai_data post type
* restore check
* remove unnecessary constant
* catch error
* pass boolean to return WP_Error
* Add support for filtering products by featured status
- Added `featured` attribute to `ProductCollectionQuery` type to enable filtering by featured status.
- Implemented `FeaturedProductsControl` to provide a toggle option in the inspector controls.
- Integrated `FeaturedProductsControl` into `ProductCollectionInspectorControls`.
- Added `get_featured_query` function in `ProductCollection` class to generate query for fetching featured products.
- Updated existing functions and queries in `ProductCollection` class to support featured products filtering.
* Revert changes to composer.lock
* Refactor handling of 'featured' parameter
This commit makes the handling of the 'featured' parameter consistent in the ProductCollection class. Previously, the 'featured' parameter was being type-casted to boolean, which was not necessary and could lead to incorrect results. Now, the 'featured' parameter is used directly without type-casting, and the check for 'featured' products in the get_featured_query method has been updated accordingly. This ensures that the 'featured' parameter is handled consistently and correctly throughout the class.
* Handle undefined 'featured' index
This commit adds null coalescing operator to handle the case when 'featured' index is not set in the $query array. This prevents potential PHP notices or errors that may arise when trying to access an undefined index.
* Add time frame filter to Product Collection block
This commit introduces the ability to filter products within the Product Collection block by a specified time frame. The changes include:
- A new 'timeFrame' property added to the DEFAULT_QUERY constant in constants.ts, initialized as null, allowing for the storage of time frame data.
- Creation of a new component `CreatedControl` in created-control.tsx that provides UI elements for selecting a time frame filter.
- Inclusion of `CreatedControl` in the Product Collection Inspector Controls.
- Expansion of the ProductCollectionQuery interface in types.ts to include a 'timeFrame' attribute.
- Addition of the 'timeFrame' parameter handling within the ProductCollection PHP class to construct and execute the date query based on the provided time frame.
The addition of the time frame filter offers enhanced flexibility in presenting products and allows users to dynamically segment their product lists based on product creation dates.
* Refactor: Standardize 'timeFrame' to be 'undefined' instead of 'null'
This commit includes a refactoring that changes the initialization and reset values for the `timeFrame` property from `null` to `undefined`. This standardization affects the constants, type definitions, and the handling of the `timeFrame` property in both the inspector controls and the PHP backend.
* Switch date query to use post_date_gmt for DST consistency
This commit changes the column reference in the date query from 'post_date' to 'post_date_gmt'. This update ensures that the product collection filtering is based on Coordinated Universal Time (UTC) rather than local time, which can be affected by Daylight Saving Time (DST) shifts. The modification will lead to more consistent and reliable behavior across different time zones and during DST changes.
* Capitalize toggle group labels
The following adjustments have been made:
- Introduced a constant `uppercaseStyle` to store the `{ textTransform: 'uppercase' }` style.
- Applied `uppercaseStyle` to both the 'IN' and 'NOT IN' toggle options to ensure label text is consistently uppercase.
- Updated the 'Not in' label text to uppercase ('NOT IN') to match the newly applied style.
These changes ensure that the toggle labels align with the design guidelines that call for uppercase styling in control elements.
* Make first letter of first work capital
* Rename to Within & Before
* Update i18n for Product Collection query operators
This commit updates the internationalization (i18n) for the Product Collection query operators in the 'Created' control component of the WooCommerce Blocks plugin. It replaces the '__' function with '_x' for translation and provides context comments for better translation handling. This improvement enhances the localization of the query operators for better multilingual support.
In WordPress 6.4, it appears that the global `have_posts` is `false` in
the context of the full site editing single product template. This
breaks the Classic Template block.
In this commit, we are creating a custom query using the available id
instead of relying on the global query.
This might be a temporary workaround as we are waiting to see
if that's an issue that core is willing to fix, as it might affect
backwards-compatibility for other vendors.
* Rename Centered Header Menu with Search pattern
Since the search bar has been removed from this pattern, this PR renames
the pattern title and slug to reflect that change.
* Rename file to reflect search removal.
Remove `search` from the filename, as this no longer reflects the
pattern.
* fix pattern route performance
* update namespace
* improve middleware
* improve ProductSchema
* improve error handling
* update identifier
* fix middleware
* update description
* use schema to return the response
* Break down the generate_content method and create the new fetch_dummy_products_to_update method for handling the fetch of dummy products to be updated.
* Ensure the Product endpoint relies on the fetch_dummy_products_to_update method for fetching dummy products to avoid code repetition and add safety checks and handle errors in case certain properties are not available.
* Add error handling for the Products endpoint.
* Remove memory limit increase and update docblocks.
* re-add set_time_limit
---------
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
In the AI prompt, there are spelling issues:
- `bellow` instead of `below`
- `json` instead of `JSON`
Unclear if this would impact responses but should be fixed regardless.
* Product Gallery Thumbnails: Add View All link to the last thumbnail (non-interactive)
* Product Gallery Thumbnails: Add interactivity to the View All overlay
* Product Gallery Thumbnails: Refactor View all html to make it more readable
* Product Gallery Thumbnails: Fixwoocommerce/woocommerce-blocks#11100 - Load all thumbnails and hide the View all overlay when in Dialog
* Product Gallery Thumbnails: Fixwoocommerce/woocommerce-blocks#11099 - Enable the dialog for the View all thumbnails overlay even when the 'Full-screen when clicked' setting is disabled
* Product Gallery Thumbnails: Remove unnecessary concatenation from the View all html
* Product Gallery Thumbnails: Abstract the View All conditions into separate functions for readability
* Product Gallery Thumbnails: Add escaping to the View all plain text string
* E2E: Fix the Sale Badge and Single Product Template tests by selecting the first Sale Badge
* Empty commit for release pull request
* Add changelog entries to readme.txt
* Update version numbers
* Add testing instructions
* Update the changelog with woocommerce/woocommerce-blocks#11421
* Always show the `Enable the shipping calculator on the cart page` option in WC Admin (https://github.com/woocommerce/woocommerce-blocks/pull/11421)
* Always show `Enable the shipping calculator ...`
Always show the `Enable the shipping calculator on the cart page` option
no matter of what is used for the cart page.
* Update remove_shipping_settings docblock to accurately describe its purpose.
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Add a safe guard that the variable is set before accessing it (https://github.com/woocommerce/woocommerce-blocks/pull/11424)
* Update zip package link
* Modify the <main> HTML tag in the title to 'main' to ensure the title remains intact
* Revert "Use the <header> element for the checkout header (https://github.com/woocommerce/woocommerce-blocks/pull/11222)"
This reverts commit 9e9ebc5039.
* Remove woocommerce/woocommerce-blocks#11222 from the Changelog and the Testing Notes
* Remove woocommerce/woocommerce-blocks#11190 from the Changelog and Testing Notes as it was never merged
* Update .zip file with latest changes
* Release: 11.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/11452)
* Empty commit for release pull request
* Do a version bump to 11.4.1
* Add Instruction Notes and update the Changelog
* Update the testing instructions and the changelog and the .zip link
* Empty commit for release pull request
* Remove the fontSize for the button (https://github.com/woocommerce/woocommerce-blocks/pull/11433)
* [Store Customization MVP] Ensure the AI-generated content in patterns is updated on plugin update (https://github.com/woocommerce/woocommerce-blocks/pull/11210)
* Update the patterns content after updating the plugin
* Remove unused variable and use statement
* Schedule action for updating the patterns content on plugin update (for both WooCommerce and WooCommerce Blocks.)
* Update condition to remove the plugin folder name
* Remove the update function from bootstrap.php
* Remove unused use
* Fix the condition, since $options['plugin'] is an array
* Remove pattern file
This was left empty by mistake in a merge, we need to remove the file or we get an error
---------
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Fix outer space and title (https://github.com/woocommerce/woocommerce-blocks/pull/11434)
* Store Customization > Update products with AI generated content (https://github.com/woocommerce/woocommerce-blocks/pull/11155)
* 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.
* Increase max execution time
* Update the products query.
* Move the media_sideload_image function dependencies to outside of the loop and add comment.
* Update text content.
* Address code review.
* bail early if no business description provided.
* Add an extra safety check in case of query errors.
* Address CR.
* Patterns > Upload optimized version of placeholder image (https://github.com/woocommerce/woocommerce-blocks/pull/11441)
* Improve vars name and remove duplicated user name (https://github.com/woocommerce/woocommerce-blocks/pull/11430)
* Add overlay with 30% opacity (https://github.com/woocommerce/woocommerce-blocks/pull/11428)
* [Store Customization] Update the "Footer with 3 Menus" (https://github.com/woocommerce/woocommerce-blocks/pull/11379)
* Fix search bar, spacing and show text in one line
* Set site log width
* Adjust margins and search bar
* Make the search bar fill space on mobile
* Update column sizes
* Remove width from site logo
* [CYS Woo Express] Update large footer (https://github.com/woocommerce/woocommerce-blocks/pull/11413)
* Update large footer
* Update space between icons
* Remove with from site logo
* update changelog and testing instructions
* bump to 11.4.2 version
* [CYS Woo Express] Fix essential header (https://github.com/woocommerce/woocommerce-blocks/pull/11449)
* Fix essential header
* Fix spacing
* update testing instructions
* Make groups to adapt better to mobile views (https://github.com/woocommerce/woocommerce-blocks/pull/11463)
* update testing instructions and changelog
* Unify the search bar layout across patterns (https://github.com/woocommerce/woocommerce-blocks/pull/11445)
* Unify the search bar layout across patterns
* restore changes
* [CYS Woo Express] Footer with simple menu and cart (https://github.com/woocommerce/woocommerce-blocks/pull/11409)
* Update footer simple menu cart
* Change structure to use rows not columns
* Make search fill space
* Fix spacing and switch mini-cart and menu
* Unify the search bar
* Remove mini cart
* update testing instructions and changelog
* Store Customization > Fetch product images from the Pexels API (https://github.com/woocommerce/woocommerce-blocks/pull/11280)
* 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.
* update changelog
* add zip link
* fix markdown
* remove duplicate testing instructions
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
Co-authored-by: Luigi <gigitux@gmail.com>
* Release: 11.4.3 (https://github.com/woocommerce/woocommerce-blocks/pull/11496)
* bump to 11.4.3
* Empty commit for release pull request
* Improve Hero Product Chessboard pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11423)
* improve pattern
* remove hardcoded font-size
* address feedback
* update to h2
* Remove group and separator to get rid of the extra space (https://github.com/woocommerce/woocommerce-blocks/pull/11477)
* [Store Customization] Update the design for the Product Gallery pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11464)
* Remove rating, show only title and price
* Improve title spacing and level
* Patterns with Search Bar: improve style (https://github.com/woocommerce/woocommerce-blocks/pull/11478)
* "Product Collection X Columns" patterns: align "no reviews" text with the star (https://github.com/woocommerce/woocommerce-blocks/pull/11468)
* improve line-height
* use variable
* add testing instructions
* Rename pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11487)
* update readme
* Store Customization > Enhance the Hero Product Split pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11505)
* Update the bottom margin for the Hero Product Split and the heading from h3 to h2.
* Update heading comment
* update testing instructions
* Simplify the `Hero Product 3 Split` pattern design (https://github.com/woocommerce/woocommerce-blocks/pull/11495)
* Simplify the pattern design
* Add char limits to the AI generated content
* Fix url
* update testing instructions
* Product Search Block: unify border-radius (https://github.com/woocommerce/woocommerce-blocks/pull/11515)
* add testing instructions
* [Store Customization] Update the Centered Header Menu with Search Pattern (https://github.com/woocommerce/woocommerce-blocks/pull/11304)
* Fix hidden elements on mobile and margins
* Increase navigation items spacing
* Add site logo width
* Improve search bar and title font weight
* Remove width from site logo
* Unify search bar
* Remove search, improve margins
* Use columns to improve the mobile view
* add testing instructions
* Large Header pattern: improve the layout on mobile view (https://github.com/woocommerce/woocommerce-blocks/pull/11490)
* Improve Large header
* improve large header
* use lens
* add padding
* add testing instructions
* Fix "Large footer" left spacing (https://github.com/woocommerce/woocommerce-blocks/pull/11520)
* Fix large footer left spacing
* Use esc_html_e
* add testing instructions
* add zip file
* improve testing instructions
* update testing instructions
* update testing instructions
---------
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
* Product Gallery: Add cropped image support
* Product Gallery: Add cropped image support
* Clean up
* Create the crop dimensions based on smallest original image dimension
* Bail if image is not available
* Fix hidden elements on mobile and margins
* Increase navigation items spacing
* Add site logo width
* Improve search bar and title font weight
* Remove width from site logo
* Unify search bar
* Remove search, improve margins
* Use columns to improve the mobile view
* Fix: Remove incorrect discount label
We don't want to mark a product as having a discount when price includes
additional costs
* Add "goToCart" E2E helper function
* Add the CartPage class
* Add the Cart product price E2E tests
* Remove unnecessary comments
* Mark the Cart shopper E2E testing file as a having side effects
* Fix the "Strict mode violation" error
* Try another fix for the "Strict mode violation"
* Add `data-wc-init` directive to Interactivity API
* Add support for variation image updates on the Product Gallery block
* Watch correct form based on the product id
* Fix php cs error
* Fix php cs error
* Prevent adding wc-init to non-variable products
* 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.
* Update footer simple menu cart
* Change structure to use rows not columns
* Make search fill space
* Fix spacing and switch mini-cart and menu
* Unify the search bar
* Remove mini cart
* Update data store docs
* Link related docs to /docs/third-party-developers/extensibility/data-store
* Improve data store overview
* Remove obsolete entry
* Update TOC of docs/third-party-developers/extensibility/data-store/store-notices.md
* Update TOCs
* Update link titles
* Replace primary key with import statement
* Optimise Validation Store description
* Keep store IDs in title
* Correct wrong key
* Optimise data store docs overview
* Explain the difference between cart and checkout store
* Add example to Validation Store
* Add example to Validation Store
* Add overview text to collections.md
* Add example to store-notices.md
* Update TOC of store-notices.md
* Update overview description of store-notices.md
* Add code snippets for displaying the validationError message
* Update data store docs
* Link related docs to /docs/third-party-developers/extensibility/data-store
* Improve data store overview
* Remove obsolete entry
* Update TOC of docs/third-party-developers/extensibility/data-store/store-notices.md
* Update TOCs
* Update link titles
* Replace primary key with import statement
* Optimise Validation Store description
* Keep store IDs in title
* Correct wrong key
* Optimise data store docs overview
* Explain the difference between cart and checkout store
* Add example to Validation Store
* Add example to Validation Store
* Add overview text to collections.md
* Add example to store-notices.md
* Update TOC of store-notices.md
* Update overview description of store-notices.md
* Add code snippets for displaying the validationError message
* Mention full link in assets/js/data/cart/README.md
* Changed Store-Notices to Store Notices
* Display shipping calculator when formatted address is present
- Earlier, shipping calculator was getting displayed based on the isAddressComplete value.
- For the scenarios where address was incomplete but formatted address was present shipping calculator was not getting displayed.
- This made shipping calculator not getting displayed for guest shoppers.
- With this, conditions are changed from isAddressComplete to formatShippingAddress to display shipping calculator if formatted address is present.
- Add unit test case for the condition for formatted address.
* Update comments to explain the condition to hide shipping calculator
- Update the comments to add the reason to hide shipping calculator.
- When there is no default customer location in the store and the customer has not entered their address, but there is a default shipping method available for all locations, then we will hide the shipping calculator.
* Remove authors filter from Product Collection block
* Remove author filed in query
* Add back the author query argument in the final query builder
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Update the patterns content after updating the plugin
* Remove unused variable and use statement
* Schedule action for updating the patterns content on plugin update (for both WooCommerce and WooCommerce Blocks.)
* Update condition to remove the plugin folder name
* Remove the update function from bootstrap.php
* Remove unused use
* Fix the condition, since $options['plugin'] is an array
* Remove pattern file
This was left empty by mistake in a merge, we need to remove the file or we get an error
---------
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
- Earlier, shipping calculator was getting displayed based on the isAddressComplete value.
- For the scenarios where address was incomplete but formatted address was present shipping calculator was not getting displayed.
- This made shipping calculator not getting displayed for guest shoppers.
- With this, conditions are changed from isAddressComplete to formatShippingAddress to display shipping calculator if formatted address is present.
- Add unit test case for the condition for formatted address.
* 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.
* Increase max execution time
* Update the products query.
* Move the media_sideload_image function dependencies to outside of the loop and add comment.
* Update text content.
* Address code review.
* bail early if no business description provided.
* Add an extra safety check in case of query errors.
* Address CR.
* Fix search bar, spacing and show text in one line
* Set site log width
* Adjust margins and search bar
* Make the search bar fill space on mobile
* Update column sizes
* Remove width from site logo
* Always show `Enable the shipping calculator ...`
Always show the `Enable the shipping calculator on the cart page` option
no matter of what is used for the cart page.
* Update remove_shipping_settings docblock to accurately describe its purpose.
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Add Toggle to inspector controls allowing shrinking number of columns
* Add logic to allow columns to shrink in Product Collection
* Rename SCSS variable
* Make sure the value provided to component is a boolean
* Rename onChange callback name to better reflect its purpose
* Add slide animation
* Remove placeholder and pagination (https://github.com/woocommerce/woocommerce-blocks/pull/11145)
* Add titles to patterns and set the aligment to Wide
* Replace product query patterns with product collection ones
* Remove pagination and no results query from product query patterns
* Add aspect ratio to the product image attributes
* Add portrait aspect ratio to product X column and product gallery patterns
* improve animation
* improve naming
* fix regression
* fix css
* improve code style
* remove check on tag image
* align image
* fix crash when zoom is disabled
* fix E2E tests
* improve CSS
---------
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
* Add transforms for checkout block
* Block to shortcode switcher in notice
* cart transforms
* Fix target block for switching
* Remove switcher UI for classic cart/checkout
* Set isPreview when generating block preview in switcher
* Onboarding task
* Action on click
* Focus on block after replacement
* Update notice styling and wording
* Undo functionality
* Look for woocommerce/classic-shortcode when determining if task list item should display
* Enable focus on the cart/checkout block when visiting from the task list
* Classic Cart/Checkout Updated Title
* Add missing translations
* Refactor modal content to avoid sprintf
* Improve pickBlockClientId
* Tracks events for switching to classic shortcode block
* TaskList support for non-block themes
* Updated placeholder to work on non-white page backgrounds
* Find blocks using findBlock utility
* Add TabbableContainer for buttons
* Add align to wrapper
* Update modal content
* Update modal usage
* Removed undo link when converting from classic shortcode
* Check if block was selected
* Revert "Removed undo link when converting from classic shortcode"
This reverts commit 2babbab4c1e69861a0371ff745e85d80ff6bbab1.
* update snackbar text
* Fix pattern spacing
Removes the top/bottom paddings, adds margins to the bottom of each pattern
* Add margin between patterns to ensure consistency between themes
* Add margin to the bottom of patterns
* Fix pattern spacing
Removes the top/bottom paddings, adds margins to the bottom of each pattern
* Add margin between patterns to ensure consistency between themes
* Add image alts to the ai prompt if available
* Update images index and remove randomness
* Update pattern with missing content
* Add image alts to the pattern array
* Improve prompt
* Fix typo
* Use the correct business_description in both the scheduled action and the endpoint
* Remove block level options in favour of settings
* Remove calculator toggle test
* Update assets/js/blocks/cart/inner-blocks/cart-order-summary-shipping/block.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Remove unused attributes
---------
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>