/** * Remove the Post Transients when a Shopp Ticket is bought * * @param int $attendee_id * @param int $order_id * @return void */ public function shopp_purge_transient($attendee_id, $order_id) { $event_id = Tribe__Tickets_Plus__Commerce__Shopp__Main::get_instance()->get_event_id_from_order_id($order_id); Tribe__Post_Transient::instance()->delete($event_id, Tribe__Tickets__Tickets::ATTENDEES_CACHE); }
/** * Check if Shopp is installed and active. * If it is and the version is compatible, load our Shopp connector. */ protected function shopp() { // Check if the legacy plugin exists if (class_exists('Tribe__Events__Tickets__Shopp__Main')) { $args = array('action' => 'deactivate', 'plugin' => $this->get_plugin_file('The Events Calendar: Shopp Tickets'), 'plugin_status' => 'all', 'paged' => 1, 's' => ''); $deactivate_url = wp_nonce_url(add_query_arg($args, 'plugins.php'), 'deactivate-plugin_' . $args['plugin']); $this->nag_data['shopp'] = array(__('Shopp', 'event-tickets-plus'), $deactivate_url, 'legacy-plugin'); return; } $shoppVersion = false; if (class_exists('ShoppVersion')) { $shoppVersion = ShoppVersion::release(); } elseif (defined('SHOPP_VERSION')) { $shoppVersion = SHOPP_VERSION; } // Pre-1.3 if (empty($shoppVersion)) { return; } // Here we will check for Comptibility problems if (!version_compare($shoppVersion, Tribe__Tickets_Plus__Commerce__Shopp__Main::REQUIRED_SHOPP_VERSION, '>=')) { $this->nag_data['shopp'] = array(__('Shopp', 'event-tickets-plus'), add_query_arg(array('tab' => 'plugin-information', 'plugin' => 'shopp', 'TB_iframe' => 'true'), admin_url('plugin-install.php')), 'incompatible'); return; } Tribe__Tickets_Plus__Commerce__Shopp__Main::get_instance(); }