Archived topic
woocommerce function in Page
1 reply · Started by Ree on May 11, 2021
1) Is there anyway to use generateblock in WooCommerce Product Page?
2) If not do I make generateblock in Page and add woocommerce element like product picture, add to cart button, quantity, reviews etc?
3) How do I use woo shortcode (eg:[add_to_cart id="99"]) to generateblock button? Or I can only use URL?
4) Since its using Page to [add to cart] how do I enable the notifcation "Product has been added to your cart" alert?
Hi there,
1.) It depends. IF you're planning to change the layout of default WooCommerce pages like the product page using the Block Element + GenerateBlocks, you can't at the moment.
If you're simply going to insert something on a particular hook using Block Element + Generateblocks then it should work fine.
2.) WooCommerce Product is a post type of its own. And it uses its own template from WooCommerce. Can't edit that with Gutenberg editor, unfortunately.
3.) Gutenberg has a default shortcode block. You can insert this block within a GB Container block.
4.) I believe the shortcode includes the render of notifications. I could be wrong though. It's a third-party plugin shortcode which isn't within the theme's scope. It's best to try.