Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Create the Add to Cart block #8188

Closed
Tracked by #8054
nefeline opened this issue Jan 15, 2023 · 5 comments · Fixed by #8284
Closed
Tracked by #8054

Create the Add to Cart block #8188

nefeline opened this issue Jan 15, 2023 · 5 comments · Fixed by #8284
Assignees
Labels
focus: FSE Work related to prepare WooCommerce for FSE. type: new block Applied to work that introduces a new block (typically used on an epic issue).

Comments

@nefeline
Copy link
Contributor

nefeline commented Jan 15, 2023

Create a block version of the add-to-cart form available on single product templates.

Property Value
Block title Add-to-cart button
Block description Display a button so the customer can add a product to their cart. Options will also be displayed depending on product type. e.g. quantity, variation.
Block slug add-to-cart
Block file location assets/js/blocks/product-add-to-cart/
Block class location src/BlockTypes/AddToCart.php
Equivalent template function woocommerce_template_single_add_to_cart()
Style
  • Typography
  • Color
  • Spacing
Visibility Woocommerce Core

The add-to-cart button template can vary depending on the product type:

Simple Product

Details:

Property Value
Equivalent template file woocommerce/templates/single-product/add-to-cart/simple.php
Equivalent template function woocommerce_simple_add_to_cart()

Screenshot:

Screenshot 2023-01-15 at 22 16 35

Grouped Product

Details:

Property Value
Equivalent template file woocommerce/templates/single-product/add-to-cart/grouped.php
Equivalent template function woocommerce_grouped_add_to_cart()

Screenshot:

Screenshot 2023-01-15 at 22 20 53

Variable Product

Details:

Property Value
Equivalent template file woocommerce/templates/single-product/add-to-cart/variable.php
Equivalent template function woocommerce_variable_add_to_cart()

Screenshots:

Screenshot 2023-01-15 at 22 28 22

Screenshot 2023-01-15 at 22 27 06

External Product

Details:

Property Value
Equivalent template file woocommerce/templates/single-product/add-to-cart/external.php
Equivalent template function woocommerce_external_add_to_cart()

Screenshot:

Screenshot 2023-01-15 at 22 24 55

@nefeline nefeline added the focus: FSE Work related to prepare WooCommerce for FSE. label Jan 15, 2023
@nefeline nefeline changed the title Create the Add to Cart Form block Create the Add to Cart block Jan 15, 2023
@nefeline
Copy link
Contributor Author

Hey @vivialice ! Would you please update the Block Title & Description listed on the description of this issue with the expected copy? Do we have an appropriate placeholder content for the editor view of this block already?

Thanks!

@vivialice
Copy link

Hey @nefeline 😄 Here is a copy suggestion for this block:

Block title:
Add-to-cart button

Description
Display a button so the customer can add a product to their cart. Options will also be displayed depending on product type. e.g. quantity, variation.

I don't have a design yet for the placeholder for this block. I can add it to my priorities, when would you need it?

@nefeline
Copy link
Contributor Author

nefeline commented Jan 18, 2023

Thank you so much @vivialice 🙌 !

I don't have a design yet for the placeholder for this block. I can add it to my priorities, when would you need it?

I plan to start working on this next week (as soon as I finish my Porter rotation), but development can progress without it, so probably in 1-2 weeks should be a-ok!

@vivialice
Copy link

Okay, thanks @nefeline !

@nefeline nefeline self-assigned this Jan 24, 2023
@vivialice
Copy link

👋 Hi @nefeline Thank you for your patience! I have selected a version for you to move ahead with - which is close to your original solution actually. The copy is slightly amended in the notice.

Screenshot 2023-01-31 at 17 31 47

@nefeline nefeline added the type: new block Applied to work that introduces a new block (typically used on an epic issue). label Feb 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: FSE Work related to prepare WooCommerce for FSE. type: new block Applied to work that introduces a new block (typically used on an epic issue).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants