Created
October 17, 2019 10:34
-
-
Save PluginHive/ca70fdf45b307e92f3b2351aa17aedb8 to your computer and use it in GitHub Desktop.
Hide quantity in checkout page for bookable products
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//snippet to hide quantity in checkout page for bookable products | |
add_filter( 'woocommerce_checkout_cart_item_quantity', 'woocommerce_checkout_cart_item_quantity_ph',10,3 ); | |
function woocommerce_checkout_cart_item_quantity_ph($quantity_html,$cart_item,$key ) { | |
if(!empty($cart_item) && isset($cart_item['product_id']) && !empty($cart_item['product_id'])) | |
{ | |
$product=wc_get_product($cart_item['product_id']); | |
if(!empty($product) && !empty($product->get_type()) && $product->get_type()=='phive_booking') | |
{ | |
return ""; | |
} | |
} | |
return $quantity_html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment