woocommerce_template_single_add_to_cart specific product id

I am trying to display a booking form (WooCommerce bookings plugin) on the home page of my website. I have created a widget space and in this widget, I want to call the function woocommerce_template_single_add_to_cart for a specific product.

So far I have:

Read More
    <?php
$post_id = '2100';
if ( !function_exists( 'woocommerce_template_single_add_to_cart' ) ) { 
        require_once '/includes/wc-template-functions.php'; 
    } 
    $result = woocommerce_template_single_add_to_cart($post_id);
?>

But it doesn’t output the booking form from product with id = 2100.

Any help would be welcome.

Related posts

Leave a Reply