* Add minimum structure for Single Product Details block
* Add Product Image Gallery woocommerce/woocommerce-blocks#8233
Add Product Image Gallery
* Add tests for Single Product Details block
* Add the initial basis for the Add to Cart button
* Trigger the single product add to cart action for each product type.
* wip: create block structure and add initial styles
* Add block details to the SingleProductDetails.php file
* Rename the block from add-to-cart-button to add-to-cart-form
* Update to use the cart icon.
* Implement the skeleton for the editor preview.
* Render tabs title with empty content
* Use woocommerce_output_product_data_tabs function to retrieve tabs data
* Update styles and add Notice for the display in the Editor.
* Update CSS.
* Add base tests for the new Add to Cart Form component.
* Add Product Image Gallery block
* remove support global styles
* remove support global styles
* Update the button CSS.
* Remove customizations for the Single Product Details block
* Update styles for the cart form.
* update td style.
* Update divs and CSS.
* Use conventional input instead of the experimental InputControl
* address CSS feedback
* add support for the custom classname
* remove save function
* Remove unnecessary console.log from the Edit.tsx file
* Remove block classname from block wrapper
* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController
* Remove attributes property from the block registration
* Remove isExperimental flag for the Single Product Details block
* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block
* Prevent Single Product Details block from apppearing in Pages or Posts
* add second parameter to the subscribe function
* Implement the new design and copy provided for the editor.
* Make the notice compatible with dark themes.
* Some additional CSS tweaks
* adjust the padding for the input
* wrap the Single Product Template in a div with the product class
* Fix PHP Coding Standards warnings
* improve logic and increase coverage of unit test
* improve logic and increase coverage of unit test
* fix test
* format HTML
* fix edge case
* update @types/wordpress__data package
* update placeholder, icon and description
* update tsconfig
* update block name
* fix SCSS linter error
* address feedback
* create SingleProductTemplateCompatibility class
* Add Hooks compatibility
* remove not used file
* remove not used files
* Add compatibility layer for the Single Product template
* fix check
* address feedback
* remove unused import
* double empty line
* remove logic in the constructor
* remove hook
* generate the docs
* add missing hooks
* fix docs
* address feedback
* fix linter
* fix import
* Disable compatibility layer when the WooCommerce Product Grid Block block and WooCommerce Single Product Block are used (https://github.com/woocommerce/woocommerce-blocks/pull/8538)
* disable compatibility layer via hook
* update docs
* generate the docs
* fix version
* fix import
* fix code after merge
---------
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Add woocommerce_blocks_loaded hook information to actions doc
* add docs to woocommerce_blocks_loaded hook inline
* fix docs
* Switch to updated wp-hooks/generator package
* Prevent syntax error in doc script from storeapi.php
* Remove footer from internal docs and examples
* Doc footer script should ignore examples and internal developer docs
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
The internal ID has been kept after a comment by @tjcafferkey. This causes a
bit of inconsistency in the internal code, but it was deemed that it would have
been better as users who have customized templates using this
blocks ID will have saved this in their database, and it would result
in a corrupt block when loaded, and we didn't want to support both IDs at the
moment.
Otherwise, most other references to the legacy template, are now using the word
“classic”.
Co-authored-by: Alba Rincón <alba@albasauatticmbp.home>
* Introduce 'wooocommerce_store_api_validate_cart' action
This action can be used by third party developers to add extra 'errors' in cart route responses. This is meant to function as a replacement of the legacy 'woocommerce_check_cart_items' hook.
* Introduce a new 'wooocommerce_blocks_draft_order_updated' action
The new action can be used to modify the finalized draft order object.
Additionally, developers can use it to throw a RouteException in order to prevent access to the checkout block.
The PR also shuffles some existing code that checks the order instance and sets the draft order ID before the 'woocommerce_blocks_checkout_update_order_meta' gets fired.
* Fix PHPCS
* Revert changes to Checkout route
* Add some extra content to the 'woocommerce_blocks_checkout_update_order_meta' docblock on the effect of exceptions thrown from callbacks
* Add __experimental prefix to 'wooocommerce_store_api_validate_cart' action
* Remove long ooo
* Add example
* Refactor cart error getters as wrappers to the validate functions
* Refactor stock_exceptions_to_wp_errors to return a single wp error.
* Add type hint in custom exception
* Fix namespace versioning and some minor improvements
* Move InvalidCartException catcher from AbstractCartRoute to AbstractRoute
* Introduce the __experimental_woocommerce_store_api_cart_errors filter
* Handle all notices and group them into a single WP_Error instance
* Cleanup doc and update example
* Cleanup NoticeHandler
* Fix doc
* Fix WP_Error namespace
* Update NoticeHandler unit tests
* Fix Unit tests typo
* Add docs to tests to bypass precommit scripts
* Refactor wp error grouping with merge_from
* Remove previous cart getters and refactor the get_cart_errors
* Fix CartSchema error getter and minor fixes
* Revert NoticeHandler exception namespace
* Unit test fix for get_cart_errors
* Switch back to do_action
* Update the example doc
* Duplicate use statement
* Update docblock in validate_cart() method for validation hooks
* Update action docs
* Remove __experimental prefix
Co-authored-by: Manos Psychogyiopoulos <psyx@somewherewarm.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* add min and step to Store API
* add min and step support
* typo
* Update assets/js/base/components/quantity-selector/index.tsx
* Update assets/js/base/components/quantity-selector/index.tsx
* Fix debounce callback
* Style qty input to show steps
* Implement quantity_limits in API
* Quantity validation
* Update product API
* Normalize on + -
* Separate add to cart events from cart item events in regards to limits
* Prevent qty change for editable line items
* Unify filters
* Remove step number indicator from buttons ¯\_(ツ)_/¯
* Normalize on mount
* Update docs
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Update wp-hooks-generator
* Update inline hook documentation into consistent format
1. Hook docs for the same hook should be identical
2. Prefix with `Hook: ` so the case of the hook is not changed.
3. Use `@see` instead of `@hooked`. Hooked is not a standard PHP Doc tag.
cc @Aljullu
* Update hook doc script to support duplicate hooks across files
* Remove unused variables in function
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Link order controller to cart routes
* Remove order controller from checkout route
* Fix PHP warnings in abstract schema
* Fix PHP warnings in abstract route
* Update shipping phone handling
* Includes are handled in core now
* Remove maybe_update_order_from_customer
* Add cart_updated routine to all cart routes
* Remove abstract method
* Remove test for woocommerce_blocks_cart_update_order_from_customer_request
* Remove do_order_callback
* Deprecate __experimental_woocommerce_blocks_checkout_update_order_meta
* Update docs to show new action and remove deprecated one
* Amend deprecated tag and add version numbers
* Resolve conflict where old hook name was included in example docs
* Deprecate __experimental_woocommerce_blocks_checkout_update_order_from_request
* Update docs to show new action and remove deprecated one
* Ensure correct args are passed to deprecated hook and update message
* Amend deprecated tag and add version numbers
* Remove incorrectly updated file from this PR
* Deprecate __experimental_woocommerce_blocks_checkout_order_processed
* Update docs to reflect new hook name
I also mentioned this hook is deprecated in the experimental interfaces doc.
* Update deprecated tag in docblock
* Fix typo in deprecated docblock
* Send args to do_action_deprecated in an array
* Amend deprecated tag and add version numbers
* move empty cart
* remove Cart and rename Cart i2 to Cart
* graduate blocks
* setup template migration from Cart i1 to Cart i2
* back to js so we have a good diff
* add migration
* fix bug in empty cart template
* add useForceLayout hook to edit
* migrate from old block to new block
* migrate styles
* respect align
* add tests
* Include latest cart line item improvements from cart-i1
* Missing changes from cart-i1
* Line items table should be disabled
* Fix e2e tests for cart i2
* update tests to adapt for inner blocks
* update select to resolveSelect to remove warning checker
* rename test/block to test/index
* move blocks to their own file
* undo rename to keep diff clean
* remove .tsx and update jest config
* Revert "update select to resolveSelect to remove warning checker"
This reverts commit 79d55de30edcfe36bbdfe7506df7a09460824f03.
* revert resolveControl
* Fix empty cart editor E2E test by scrolling to the view switch
* parse attributes for order summary block
* migrate attributes when resaving
* Update documentation
Automatic update after running npm run build:docs
* add align options to filled cart and empty cart
* append instead of replcae
* import style.scss in frontend
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>