我的一个客户正在WordPress/WooCommerce安装上使用yith WooCommerce Booking插件.
他想把它与他使用的外部程序连接起来,我被困在创建一个来自他的程序的新预订上.
预订已成功创建,并且后端将其视为全部,但Products页面上的前端AJAX日历并未刷新,而是显示了旧的可用性.
我的代码的演示部分如下:
$booking = get_post(5404);
$booking->post_status = 'bk-cancelled';
wp_update_post($booking);
$GLOBALS['wpdb']->update( $GLOBALS['wpdb']->posts, $booking, array( 'ID' => 5404 ) );
clean_post_cache( 5404 );
do_action( 'yith_wcbk_booking_updated', $booking );
do_action( 'yith_wcbk_update_booking', 5404, $booking );
$booking = yith_get_booking( $booking );
$booking->save();
在此步骤中,我正try 以编程方式将现有yith WooCommerce预订的状态更新为已取消,虽然它在产品页面的后端工作,但它不清除日期.
有什么 idea 吗?