Last active
October 24, 2019 13:11
-
-
Save PluginHive/af7126481b9bf115369f51a4b64138fa to your computer and use it in GitHub Desktop.
Display total participant as order item quantity in email (If Consider each participant as separate booking is enabled)
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
function display_total_participant_in_email_order_item_quantity($quantity,$item =array()) { | |
if(!empty($item) && !empty($item->get_product_id()) ) { | |
$product_id=$item->get_product_id(); | |
$_persons_as_booking = get_post_meta( $product_id, "_phive_booking_persons_as_booking", 1 ); | |
if($_persons_as_booking=='yes') | |
{ | |
$no_of_persons=$item->get_meta('Number of persons',true); | |
if(!empty($no_of_persons)) | |
{ | |
return $no_of_persons; | |
} | |
else | |
{ | |
return '-'; | |
} | |
} | |
else | |
return '-'; | |
} | |
return $quantity; | |
} | |
add_filter( 'woocommerce_email_order_item_quantity', 'display_total_participant_in_email_order_item_quantity',10,2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment