【发布时间】:2017-11-25 11:28:44
【问题描述】:
我正在尝试调整 WP Woocommerce 预订插件并添加从 Google 日历 API 获取事件的功能。
有课
WC_Bookings_Google_Calendar_Integration 类扩展了 WC_Integration
,提供令牌获取和授权。
我在类中添加了新功能
公共函数 get_googlecal_bookings( $bookable_product, $min_date = 0, $max_date = 0)
假设检索特定产品最小和最大日期之间的所有预订。
从我的functions.php我用
调用它$existing_bookings = WC_Bookings_Google_Calendar_Integration::get_googlecal_bookings($bookable_product, $从,$到);
这适用于虚拟数据。
虽然,当我尝试在 function get_googlecal_bookings 中使用其他类函数时,例如 $api_url = $this->calendars_uri . $this->calendar_id . '/events/'; 或 $access_token = $this->get_access_token();,我什么也得不到。
我知道我叫错了,只需要指出正确的方向
【问题讨论】:
标签: php wordpress woocommerce woocommerce-bookings