Indhold vises via skabelon.
Tag: WooCommerce
-
Crash Introduction: Woocommerce REST API
Woocommerce REST API
Here is a short introduction to the Woocommerce REST API. In the tutorial you will learn how to present a product list from the REST API on any HTML page. If you want to create your own markup that does not depend on the limited Woocommerce blocks in the editor the REST API will open endless possibilities.
Sample Code on Github
The code from the tutorial is available on Github:
Questions and Comments
If you have comments or suggestions for new videos about the subject please let me know in the comments below.
-
WooCommerce Research
Research Notes for a e-Commerce Class. How to set up WooCommerce with sample data, fake payment and block based editors.
The Sample data for WooCommerce is located in sample-products.csv or sample-products.xml, which are located in the WooCommerce plugin folder in woocommerce/sample-data/
Check this article.
An alternative is this file.
Video
FakerPress is used in the video above
FakePay for WooCommerce
The video has an interesting feature: a functions.php hack that will enable Gutenberg (and other page builders) in WooCommerce. However, the authors tell, that this way of doing things may become deprecated soon.
Edit Products in Gutenberg
Enable Gutenberg
Note: this code could be deprecated soon.
Add this to functions.php:
// enable gutenberg for woocommerce function activate_gutenberg_product( $can_edit, $post_type ) { if ( $post_type == 'product' ) { $can_edit = true; } return $can_edit; } add_filter( 'use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2 ); // enable taxonomy fields for woocommerce with gutenberg on function enable_taxonomy_rest( $args ) { $args['show_in_rest'] = true; return $args; } add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' ); add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' );
WooCoomerce 2023 tutorial