Skip to content

Instantly share code, notes, and snippets.

@digamber89
digamber89 / functions.php
Last active Apr 25, 2021
Change Calendar Buttin
View functions.php
<?php
function cm_change_meeting_link_for_purchasable_product( $response, $post_id ) {
$woocommerce_fields = get_post_meta( $post_id, '_meeting_fields_woocommerce', true );
$zoom_prodcut_id = get_post_meta( $post_id, '_vczapi_zoom_product_id', true );
if ( $woocommerce_fields['enable_woocommerce'] && $zoom_prodcut_id ) {
//uncomment to link to product page
//$response['meetingLink'] = '<a href="'.get_permalink($zoom_prodcut_id).'">Buy Now</a>';
$buy_now_link = add_query_arg( [
'add-to-cart' => $zoom_prodcut_id
], wc_get_cart_url() );
@digamber89
digamber89 / functions.php
Created Mar 30, 2021
Buy Now - Zoom Integration for WooCommerce
View functions.php
<?php
function change_vczapi_buy_now_text( $buy_now_text ) {
$buy_now_text = 'Text to be changed';
return $buy_now_text;
}
add_filter( 'vczapi_buy_now_text', 'change_vczapi_buy_now_text' );
@digamber89
digamber89 / functions.php
Last active Mar 3, 2021
Video Conferencing with Zoom API - change slug
View functions.php
<?php
//must flush permalinks after code is added admin menu > settings > permalinks save
add_filter('vczapi_cpt_slug','cm_change_zoom_meetings_slug');
function cm_change_zoom_meetings_slug(){
return 'my-meetings';
}
@digamber89
digamber89 / functions.php
Last active Feb 24, 2021
Zoom Integration for WooCommerce - purchase past meetings
View functions.php
<?php
add_filter( 'vczapi_wc_check_valid_deadline', '__return_false' );
@digamber89
digamber89 / bookings.php
Created Feb 22, 2021
Hide Join Link in Completed Meetings - Zoom Integration for WooCommerce Bookings
View bookings.php
<?php
/**
* My Bookings
*
* Shows customer bookings on the My Account > Bookings page
*
* This template can be overridden by copying it to yourtheme/woocommerce-bookings/myaccount/bookings.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
@digamber89
digamber89 / functions.php
Created Feb 22, 2021
Change sort order - Video Conferencing with Zoom API
View functions.php
<?php
add_action( 'wp_footer', 'cm_vczapi_change_sorting_for_recoring' );
function cm_vczapi_change_sorting_for_recoring() {
ob_start();
?>
(function($){
$recordingMeetingDatatable = $('.cm-vczapi-custom-data-table');
if($recordingMeetingDatatable !== undefined && $recordingMeetingDatatable.length > 0){
$recordingMeetingDatatable.DataTable({
responsive: true,
@digamber89
digamber89 / functions.php
Created Feb 12, 2021
Zoom Integration for WooCommerce - Make Zoom Meeting visible by default
View functions.php
<?php
/**
* @param WC_Product $objProduct
*/
function cm_set_zoom_product_visibility_to_shown_by_default($objProduct){
$objProduct->set_catalog_visibility('visible');
}
add_action('vczapi_before_new_zoom_product_saved','cm_set_zoom_product_visibility_to_shown_by_default');
@digamber89
digamber89 / functions.php
Last active Feb 12, 2021
Zoom Integration for WooCommerce Bookings - Remove Join Via App on Order Details
View functions.php
<?php
if ( class_exists( '\Codemanas\ZoomWooBookingAddon\WooCommerce\Orders' ) ):;
remove_action( 'woocommerce_order_item_meta_end', [ Codemanas\ZoomWooBookingAddon\WooCommerce\Orders::get_instance(), 'email_meeting_details' ], 20 );
add_action( 'woocommerce_order_item_meta_end', 'cm_email_meeting_details_without_zoom_via_app', 20, 3 );
function cm_email_meeting_details_without_zoom_via_app( $item_id, $item, $order ) {
if ( $order->get_status() === "completed" || $order->get_status() === "processing" ) {
$product_id = $item['product_id'];
$post_id = get_post_meta( $product_id, '_vczapi_zoom_post_id', true );
if ( ! empty( $post_id ) ) {
$fields = get_post_meta( $post_id, '_meeting_fields_woocommerce', true );
@digamber89
digamber89 / functions.php
Created Feb 8, 2021
Zoom Integration for WooCommerce - remove Host from Cart Details
View functions.php
<?php
if ( class_exists( '\Codemanas\ZoomWooCommerceAddon\Cart' ) ) {
remove_filter( 'woocommerce_cart_item_name', [ \Codemanas\ZoomWooCommerceAddon\Cart::get_instance(), 'cart_meeting_details' ], 10 );
add_filter( 'woocommerce_cart_item_name', 'cm_zoom_cart_meeting_details', 10, 3 );
function cm_zoom_cart_meeting_details( $name, $cart_item, $cart_item_key ) {
$product_id = $cart_item['product_id'];
$post_id = get_post_meta( $product_id, '_vczapi_zoom_post_id', true );
if ( ! empty( $post_id ) ) {
$meeting_details = get_post_meta( $post_id, '_meeting_fields', true );
@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');
}
}