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

Research how extensions extend Single Product template #8204

Closed
Tracked by #8054
gigitux opened this issue Jan 16, 2023 · 6 comments
Closed
Tracked by #8054

Research how extensions extend Single Product template #8204

gigitux opened this issue Jan 16, 2023 · 6 comments
Assignees
Labels
focus: FSE Work related to prepare WooCommerce for FSE.

Comments

@gigitux
Copy link
Contributor

gigitux commented Jan 16, 2023

We need to research how extensions extend the Single Product template.

As @dinhtungdu did for the Archive Templates, we have to limit our investigation to the extensions and themes on www.woocommerce.com

Also, this page could be a great starting point to see all the hooks available on the Single Product page.

@gigitux gigitux added the focus: FSE Work related to prepare WooCommerce for FSE. label Jan 16, 2023
@gigitux
Copy link
Contributor Author

gigitux commented Jan 17, 2023

Hook usage by extensions in WooCommerce.com:

Hook Count
woocommerce_before_add_to_cart_button 109
woocommerce_after_add_to_cart_button 45
woocommerce_before_single_product 41
woocommerce_single_variation 40
woocommerce_after_single_product_summary 36
woocommerce_before_add_to_cart_form 34
woocommerce_before_single_product_summary 26
woocommerce_simple_add_to_cart 21
woocommerce_after_add_to_cart_form 17
woocommerce_product_thumbnails 14
woocommerce_product_meta_end 12
woocommerce_variable_add_to_cart 11
woocommerce_after_single_product 11
woocommerce_after_main_content 10
woocommerce_before_main_content 8
woocommerce_product_meta_start 5
woocommerce_grouped_add_to_cart 4
woocommerce_external_add_to_cart 2
woocommerce_product_additional_information 2
woocommerce_before_quantity_input_field 1
woocommerce_after_quantity_input_field 1
woocommerce_review_after_comment_text 1
woocommerce_sidebar 0
woocommerce_share 0
woocommerce_product_after_tabs 0
woocommerce_review_before 0
woocommerce_review_before_comment_meta 0
woocommerce_review_meta 0
woocommerce_review_before_comment_text 0
woocommerce_review_comment_text 0

@gigitux gigitux self-assigned this Jan 17, 2023
@gigitux
Copy link
Contributor Author

gigitux commented Jan 17, 2023

Also, the entire list of the hook used in the Single Product Page is visible here

@gigitux
Copy link
Contributor Author

gigitux commented Jan 17, 2023

As @dinhtungdu noticed, we can avoid adding compatibility with the hook woocommerce_sidebar. For the rest, we have to work on a compatibility layer. I think that the observations done on #8064 are the same here.

What do you think? @nerrad @Aljullu

@Aljullu
Copy link
Contributor

Aljullu commented Jan 18, 2023

Yes, it makes sense to me. My only thought is that given that for some blocks we will be using the PHP template for now (Add to Cart form, Product Gallery, etc.), I expect that some of those hooks will already be supported and will not need to be in the compatibility layer.

@gigitux
Copy link
Contributor Author

gigitux commented Jan 18, 2023

My only thought is that given that for some blocks we will be using the PHP template for now (Add to Cart form, Product Gallery, etc.),

Yeah, I completely agree! I just added them for completeness. Also, the list will be helpful if/when we decide not to use the PHP template anymore 💪.

@gigitux
Copy link
Contributor Author

gigitux commented Jan 18, 2023

I'm going to close this issue! The research is done! 💪

@gigitux gigitux closed this as completed Jan 18, 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.
Projects
None yet
Development

No branches or pull requests

2 participants