Skip to content

Instantly share code, notes, and snippets.

@digamber89
digamber89 / functions.php
Last active Jan 18, 2021
Moment JS Conflict - Video Conferencing with Zoom
View functions.php
<?php
add_action('wp_print_scripts','cm_dont_load_moment');
function cm_dont_load_moment(){
if(is_singular('zoom-meetings') ){
wp_dequeue_script('moment');
wp_deregister_script('moment');
}
}
@digamber89
digamber89 / customer-booking-reminder-sement.php
Last active Dec 29, 2020
Add Join Links to Reminder Emails - Zoom Integration for WooCommerce Bookings
View customer-booking-reminder-sement.php
<?php
$join_link = \Codemanas\ZoomWooBookingAddon\DataStore::get_join_link($booking);
if($join_link){
?>
<tr>
<th style="text-align:left; border: 1px solid #eee;" scope="row"><?php _e('Join meeting','woocommerce-bookings'); ?></th>
<td style="text-align:left; border: 1px solid #eee;"><?php echo $join_link; ?></td>
</tr>
<?php
}
@digamber89
digamber89 / functions.php
Created Dec 24, 2020
Zoom WooCommerce Bookings change Join via App and Join via Browser test
View functions.php
<?php
//Change Join Via App and Join Via Browser text for WooCommerce Bookings
add_filter( 'vczoom_join_meeting_via_app_text', 'cm_change_join_via_app_text' );
function cm_change_join_via_app_text( $join_via_app_text ) {
$join_via_app_text = 'Join Zoom Via App';
return $join_via_app_text;
}
add_filter( 'vczoom_join_meeting_via_browser_text', 'vczoom_join_meeting_via_browser_text' );
@digamber89
digamber89 / functions.php
Created Dec 18, 2020
Zoom for WooCommerce Appointments change Meeting title
View functions.php
<?php
add_filter('vczapi_woocommerce_appointments_create_meeting_params', 'cm_change_meeting_topic_title_for_appointments',10,4);
function cm_change_meeting_topic_title_for_appointments ($meeting_params, WC_Appointment $wc_appointment, $proudct_id, $order_id){
$order = wc_get_order($order_id);
$full_name = $order->get_billing_first_name() .' '.$order->get_billing_last_name();
$meeting_params['meetingTopic'] = "Appointment for ".$full_name.' - '.$wc_appointment->get_id();
return $meeting_params;
}
@digamber89
digamber89 / functions.php
Created Dec 10, 2020
Membership Restriction for Zoom Sidebar
View functions.php
<?php
function cm_woo_membership_restrict_content_start(){
ob_start();
}
add_action( 'vczoom_single_content_right','cm_woo_membership_restrict_content_start', 1 );
function cm_woo_membership_restrict_content_end(){
$content = ob_get_clean();
echo do_shortcode('[wcm_restrict]'.$content.'[/wcm_restrict]');
}
add_action( 'vczoom_single_content_right','cm_woo_membership_restrict_content_end', 100 );
@digamber89
digamber89 / functions.php
Last active Jan 8, 2021
Change Zoom Meeting Title - when Booked - Zoom for WooCommerce Bookings
View functions.php
<?php
function cm_change_booking_title( $meeting_params, $wc_booking, $product_id, $order_id ) {
$order = wc_get_order( $order_id );
if( is_object($order)){
$name = $order->get_billing_first_name() .' '. $order->get_billing_last_name();
$product = wc_get_product($product_id);
$meeting_params['meetingTopic'] = $product->get_name().' - '.$name.' - '.$order_id;
}
return $meeting_params;
}
@digamber89
digamber89 / functions.php
Created Dec 8, 2020
Turn on participants and hosts video by default
View functions.php
<?php
function cm_turn_on_video_settings( $meeting_params ) {
$meeting_params['option_host_video'] = true;
$meeting_params['option_participants_video'] = true;
return $meeting_params;
}
@digamber89
digamber89 / functions.php
Created Dec 7, 2020
Hide Past Meeting Products from Shop and Other Pages
View functions.php
<?php
function cm_exclude_past_meeting_products( $q ) {
$args = [
'post_type' => 'zoom-meetings',
'posts_per_page' => - 1,
'meta_query' => [
'relation' => 'AND',
[
@digamber89
digamber89 / functions.php
Last active Nov 26, 2020
Remove Zoom Meetings from My Account Page
View functions.php
<?php
add_action('init','remove_zoom_meetings_from_woocommerce_my_accoount_page');
function remove_zoom_meetings_from_woocommerce_my_accoount_page(){
$orders = \Codemanas\ZoomWooCommerceAddon\Orders::get_instance();
remove_filter( 'woocommerce_account_menu_items', array( $orders, 'meeting_link' ), 5 );
add_action( 'woocommerce_account_wc-zoom-meetings_endpoint', array( $orders, 'display_links' ) );
}
@digamber89
digamber89 / functions.php
Created Nov 19, 2020
Show Zoom product in shop pages
View functions.php
<?php
add_action('vczapi_before_zoom_product_saved','change_zoom_product_on_create');
/**
* @param WC_Product $product
*/
function change_zoom_product_on_create($product){
$product->set_catalog_visibility('visible');
}