Commit Graph

4832 Commits

Author SHA1 Message Date
Albert Juhé Lluveras c9a6391e20 Fix border styles not visible in the editor in Featured Product and Featured Category blocks in core (https://github.com/woocommerce/woocommerce-blocks/pull/8838) 2023-03-23 15:36:46 +01:00
Albert Juhé Lluveras bf73555ee3 Update woocommerce/woocommerce-blocks#8494 testing steps for WC Blocks 9.7.0 to account for recent changes introduced after the PR was created 2023-03-23 15:19:13 +01:00
Luigi Teschio d5cb9b0248 Product SKU: no render the prefix when the SKU isn't defined (https://github.com/woocommerce/woocommerce-blocks/pull/8837) 2023-03-23 14:08:48 +00:00
Roy Ho 48fde013ea Add decoding to product names (https://github.com/woocommerce/woocommerce-blocks/pull/8824)
* Add decoding to product names

* Fix linting error
2023-03-23 06:27:02 -07:00
Albert Juhé Lluveras 0bfd760c25 9.7.0 testing steps: move Product Price styling steps to the Feature Plugin section 2023-03-23 11:59:51 +01:00
Mike Jolley 280040653c Avoid returning before hooks are run (https://github.com/woocommerce/woocommerce-blocks/pull/8820) 2023-03-23 10:24:04 +00:00
Luigi Teschio 9baad55f4f Stock Indicator Block: remove unused save function (https://github.com/woocommerce/woocommerce-blocks/pull/8832) 2023-03-23 08:43:42 +00:00
kmanijak a06f4fbd91 Normalise the search param for comparison to avoid endless redirections (https://github.com/woocommerce/woocommerce-blocks/pull/8784)
* Replace single quote with the encoded version %27 for URL comparison

This is required as as removeQueryArgs() function uses decodeURIcomponent method which doesn't encode single quotes (') while it was still encoded in the original URL (%27). So when the single quote was in a query param, for example as a search term, it caused endless redirection loop.

* Replace single quote with the encoded version %27 for URL comparison in Filter by Rating

* refactor the solution so it encodes the href rather than decode the newly created URL

* Refactor the normalisation

* Add tests to normalisation function
2023-03-23 08:42:23 +01:00
Albert Juhé Lluveras f29954abbc Add 9.8.2 testing steps 2023-03-22 16:07:16 +01:00
Albert Juhé Lluveras 03846552cf Add 9.8.2 changelog 2023-03-22 16:07:09 +01:00
Alexandre Lara f39d8b7943 Add default Single Product HTML template (https://github.com/woocommerce/woocommerce-blocks/pull/8515)
* Add default Single Product HTML template

* Fix style issues when adding blocks inside group/stack/columns blocks

* Add Related Products to the default single product template HTML file

* Remove !important statement from Product Image Gallery block css

* Change width of Product Image Gallery block to initial instead of unset

* Wrap up default single product html template (https://github.com/woocommerce/woocommerce-blocks/pull/8632)

* 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

* implement Product meta template header

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* remove classname

* fix crash

* update template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Fix images width in the Single Product page

* Remove the !important attribute from the Product Image Gallery block

* fix sku block

* improve layout

* fix header and footer template parts declaration

---------

Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-22 15:00:48 +00:00
Albert Juhé Lluveras 24be5ab041 Update 9.8.0 testing steps for woocommerce/woocommerce-blocks#8594 so they account for WC core testing 2023-03-22 14:04:42 +01:00
Paulo Arromba 9f7bf6fb04 Added CheckoutSchema::$image_attachment_schema property (https://github.com/woocommerce/woocommerce-blocks/pull/8802) 2023-03-22 13:04:24 +00:00
Saad Tarhi 547cc76f8e Fix save changes bug in Firefox browser (https://github.com/woocommerce/woocommerce-blocks/pull/8754) 2023-03-22 12:45:48 +00:00
kmanijak a5714a6519 Use shared save function for all the product elements blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8813)
* Use attributes provided to save function in product-price block

* remove save function and use the shared one

* fix import

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-03-22 11:52:50 +00:00
Seghir Nadir ad23e12dc9 fix shipping test (https://github.com/woocommerce/woocommerce-blocks/pull/8815) 2023-03-22 12:24:45 +01:00
kmanijak 752fd37a0b Make Product SKU editable (https://github.com/woocommerce/woocommerce-blocks/pull/8804) 2023-03-22 09:29:49 +01:00
Albert Juhé Lluveras 5235f6c392 Allow themes to remove the Mini Cart title on overridden template parts (https://github.com/woocommerce/woocommerce-blocks/pull/8779)
* Allow themes to remove the Mini Cart title on overridden template parts

* Remove unused file
2023-03-22 08:23:52 +01:00
Tarun Vijwani 82c59ffb29 Display the link to add the shipping address when shipping address is not available (https://github.com/woocommerce/woocommerce-blocks/pull/8141) 2023-03-22 11:15:13 +04:00
Albert Juhé Lluveras 6a629c60b2 Fix Customer Account block doing a 404 request in the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/8798) 2023-03-21 11:31:20 +01:00
Mike Jolley ef97fad080 Add woocommerce_cart_item_permalink filter to cart endpoint (https://github.com/woocommerce/woocommerce-blocks/pull/8726) 2023-03-21 10:14:29 +00:00
Albert Juhé Lluveras a85b80e6ac Update release version at the beginning of the release process (https://github.com/woocommerce/woocommerce-blocks/pull/8788)
* Update release version at the beginning of the release process

* Add back code that updated versions on deploy
2023-03-20 18:07:15 +01:00
Luigi Teschio f9cdca7625 Remove Single Product Block (https://github.com/woocommerce/woocommerce-blocks/pull/8763)
* Remove Single Product Block

* remove more files that belong the Single Product block

* fix php linter error

* remove Product Tag List and Product Category List blocks
2023-03-20 13:27:23 +00:00
Albert Juhé Lluveras 23312534da Release process: check svn tag before WP.org version and add instruction about dev notes (https://github.com/woocommerce/woocommerce-blocks/pull/8756)
* Release steps: check svn version before checking WP.org version

* Add instruction to include dev notes
2023-03-20 11:24:06 +01:00
Luigi 82d27155d5 Merge branch 'release/9.6.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-03-17 16:59:27 +01:00
github-actions[bot] 29e49f76d5 Release: 9.6.6 (https://github.com/woocommerce/woocommerce-blocks/pull/8778)
* Empty commit for release pull request

* Add changelog to readme.txt

* Unset default customer state if it doesn't match country (https://github.com/woocommerce/woocommerce-blocks/pull/8460)

* Unset default state

* add controller for customers

* rename validation file

* explain fix inline

* address feedback

* revert back state logic

* Update src/StoreApi/Utilities/ValidationUtils.php

Co-authored-by: Mike Jolley <mike.jolley@me.com>

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update readme.txt

* Add testing notes

* Update testing notes

* Fix Customer account sidebar link incorrect margin in WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8437)

* Fix Customer account sidebar link incorrect margin in WP 6.2

* Update class name to match the guidelines

* Prevent cart from breaking when item_data contains an array (https://github.com/woocommerce/woocommerce-blocks/pull/8440)

* Ensure array item data is removed

* Remove unused key

* Clean up code and add comments

* Check for null instead of empty

* Use plain foreach to filter and map arrays

* Add minimum height to Mini Cart Contents block in the Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8458)

* Update testing notes zip file

* Update testing notes

* Update testing notes file

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* disable compatibilty layer (https://github.com/woocommerce/woocommerce-blocks/pull/8507)

* update changelog and testing instructions

* add zip link

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Add changelog in readme.txt

* Add testing notes

* Remove change from testing notes

This requires AvaTax credentials for testing. So, we'll test for
regressions instead

* Check for null session before going forward (https://github.com/woocommerce/woocommerce-blocks/pull/8537)

* Fix Payment Options settings crash in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/8535)

* Ensure express payment buttons are visible next to each other (https://github.com/woocommerce/woocommerce-blocks/pull/8548)

* Update ZIP file

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Update readme.txt

* Show three Express Payments buttons in-line (https://github.com/woocommerce/woocommerce-blocks/pull/8601)

* Add testing notes

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Add changelog in readme.txt

* Undo dirty prop removal on error (https://github.com/woocommerce/woocommerce-blocks/pull/8633)

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Add testing notes

* fix 404 error (https://github.com/woocommerce/woocommerce-blocks/pull/8445)

* Empty commit for release pull request

* add testing instruction

* update zip link

* fix version

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-03-17 16:47:41 +01:00
Tarun Vijwani ef24a42211 Add validation error to prevent checkout when there is no shipping method available (https://github.com/woocommerce/woocommerce-blocks/pull/8384)
* Prevent checkout when no shipping rates available

-  Add the validation error in ShippingSelector to prevent checkout when no shipping rates available.
- Add notice to Checkout processor so that notice appears after clicking on place order button.

* Fix TypeScript error in checkout shipping method block

-   Make multiple prop as optional in RatePrice component to fix TypeScript error.
2023-03-17 19:32:03 +04:00
Mike Jolley 68c6990872 Enhancement/local pickup order confirmation (https://github.com/woocommerce/woocommerce-blocks/pull/8727)
* Hide shipping address from local pickup order confirmation page

* Add pickup details to confirmations

* Error handling

* Update test because columns may be hidden

* use address selector

* Custom selector for local pickup

* try forcing flat rate during test
2023-03-17 14:15:13 +00:00
Albert Juhé Lluveras ec19838355 Fix issue that prevented spaces being added to Mini Cart, Cart and Checkout buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8777)
* Fix issue that prevented spaces being added to Mini Cart, Cart and Checkout buttons

* Fix a couple of comments
2023-03-17 13:26:34 +01:00
kmanijak 28c7bfc801 Change the example of GET products by category from category name to ID (https://github.com/woocommerce/woocommerce-blocks/pull/8774) 2023-03-17 13:24:00 +01:00
Luigi Teschio 6dfee2664e fix isDescendentOfSingleProductTemplate check (https://github.com/woocommerce/woocommerce-blocks/pull/8767) 2023-03-17 10:22:51 +01:00
Alba Rincón dca03c3323 Add styles to the `Start shopping` button (https://github.com/woocommerce/woocommerce-blocks/pull/8766) 2023-03-16 14:57:54 +01:00
Luigi Teschio 235b37a626 Product Search Results template: fix the preview when the Inherit Query option is enabled (https://github.com/woocommerce/woocommerce-blocks/pull/7965)
* Product Search Results: fix the preview when the Inherit Query option is enabled

* create a component to make the code more readable

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-03-16 11:04:52 +01:00
Daniel W. Robert 30f08a644f Updates version for @woocommerce/block-library (https://github.com/woocommerce/woocommerce-blocks/pull/8733)
Lockfile is using v9.8.0-dev for the @woocommerce/block-library
dependency. This update bumps that dep version to v9.9.0-dev.
2023-03-15 12:22:06 -04:00
Luigi Teschio c893a795b1 inject hooks on the first block after the main div wrapper (https://github.com/woocommerce/woocommerce-blocks/pull/8702) 2023-03-15 14:12:31 +00:00
Albert Juhé Lluveras 9f3f460372 Add WC Blocks 9.8.1 changelog and testing steps 2023-03-15 14:37:34 +01:00
Roy Ho a55b63f96c Add get_product_by_metas method to query the lookup table (https://github.com/woocommerce/woocommerce-blocks/pull/8645)
* Add get_product_by_metas method to query the lookup table

* Remove cache and return db column instead

* Update src/StoreApi/Utilities/ProductQueryFilters.php

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Fix phpcs violations

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-15 05:32:25 -07:00
Tarun Vijwani ef63d807b9 Fix the local pickup price in the shipping type selector and pickup options (https://github.com/woocommerce/woocommerce-blocks/pull/8623)
* Fix local pickup price in the shipping type selector

- While calculating min and max value for local pickup, if the rate is not for local pickup, it will take already calculated lowest value instead of comparing it with the value of other shipping rate.

* Add the typecasting for price and tax to fix tax calculation

- We were concatenating the two strings instead of adding the integers. Add the typecasting for price and tax to fix it in local pickup.

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-03-15 13:26:06 +01:00
Roy Ho 44cdcc8770 Add method to get products based on filtered term (https://github.com/woocommerce/woocommerce-blocks/pull/8598)
* Add method to get products based on filtered term

* Use convenient taxonomy name wrapper

* Add caching and switch to return array instead of object

* Remove cache and address comments
2023-03-15 05:08:51 -07:00
kmanijak afa8672e49 Change the property name of the attribute slug in Products By Attribute after the refactor (https://github.com/woocommerce/woocommerce-blocks/pull/8759) 2023-03-15 12:29:13 +01:00
Luigi Teschio 5a3e7b5afc fix: disable compatibility layer for block themes that have a default block template (https://github.com/woocommerce/woocommerce-blocks/pull/8758) 2023-03-15 11:20:08 +00:00
Tarun Vijwani 8a35fc0fcf Fix Local pickup e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/8745)
* Fix local pick-up e2e tests

- Change location_country select input to location_country_state select input in e2e tests.
- Remove location_state select input in e2e tests.

* Fix country/state value

- Change country/state value from 'US' to 'United States (US) — California'

* Add inline comment about same field for Country and State fields

- We merged the Country and State fields into the same field in the local pickup modal. Add inline comment in e2e test to avoid confusion.
2023-03-15 10:59:04 +04:00
Roy Ho 112a402261 Add a higher z-index than the title for mini cart close button (https://github.com/woocommerce/woocommerce-blocks/pull/8737) 2023-03-14 10:08:10 -07:00
Alba Rincón d4fe2a5b5d Mini-cart: add setting to not render the block on the cart & checkout pages (https://github.com/woocommerce/woocommerce-blocks/pull/8700)
* Add `renderInCartAndCheckout` attribute and toggle

* Show setting only when inserted in a template

* Don't render the mini-cart if the setting is disabled

* Stop rendering the mini-cart if the setting is false

* method to snakecase

* Make the attribute a string

In the future we may want to add more rendering styles, so a boolean wasn't the
best option, a string will allowed us more than two options

* Change toggle copy
2023-03-14 15:59:46 +01:00
Patricia Hillebrandt a3b4dbcf76 Fix Markdown table in payment-method-integration.md > external contribution woocommerce/woocommerce-blocks#8158 (https://github.com/woocommerce/woocommerce-blocks/pull/8258)
* Fix Markdown table in payment-method-integration.md

* Update the hooks for eventRegistration

---------

Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-03-14 11:29:35 -03:00
Saad Tarhi abe3488861 Local Pickup: merge country and state into same field in location modal (https://github.com/woocommerce/woocommerce-blocks/pull/8408)
* Get the default store state

We are merging the Country & State fields. So, we should get both
default values

* Merge the Country & State fields

We merged both fields in the Pickup Location form modal

We can see a similar example in `WooCommerce -> Settings -> General`

* Clean up the code

* Show the state text field above the country select

* Create some util functions

* Refactor the Form component

* Display a user friendly country and state in admin

* Fix country defaulting to "Afghan" bug
2023-03-14 14:49:31 +01:00
Luigi Teschio a2945306ac Fix the related products block result when used along a grouped product (https://github.com/woocommerce/woocommerce-blocks/pull/8656)
* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* fix crash
2023-03-14 14:28:21 +01:00
Niels Lange 83b5019e4d Add client side postcode validation (https://github.com/woocommerce/woocommerce-blocks/pull/8503)
* Add client side postcode validation

* Prevent server-side validation

* Adjust translation

* Only validate postcode if country is available

* Specify return type of isPostcode()

* Convert function to static variable set

* Refactor <ValidatedTextInput> for postcode validation

* Refactor customValidationHandler

* Use customValidationHandler as intermediate function

* Hyphenate file names

* Update packages/checkout/utils/validation/is-postcode.ts

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Normalise postcode on input

* Fix usage of out of date value from input field

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-03-14 19:37:28 +07:00
Albert Juhé Lluveras 312d9b6582 Update dev version to 9.9.0-dev 2023-03-14 11:56:23 +01:00
Albert Juhé Lluveras cb79ce452f Add WC Blocks 9.8.0 testing steps 2023-03-14 11:54:43 +01:00