<?php
/**
* Snippet Name: Display the Add Cart Form on WooCommerce Shop page for variable products.
*/
add_action( 'woocommerce_after_shop_loop_item', 'display_whole_add_cart_form', 1 );
function display_whole_add_cart_form() {
global $product;
if ( ! $product->is_purchasable() ) return;
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 11 );
}
Kishore Sahoo
Kishore is based in Bangalore, IT Capital of India, specialising in PHP frameworks and CMS where he provides Handcrafted Websites and Applications based on WordPress or Laravel as backend technology & building & deploying powerful Application on the cloud.
Specialties: Problem-Solving, Solution Architectures, Startup Initiative, MVP, WordPress, PHP
Leave a Reply