context = adp_context(); $this->loadRequirements(); } public function withContext(Context $context) { $this->context = $context; } public function loadRequirements() { if ( ! did_action('plugins_loaded')) { /* translators: Message about the load order*/ _doing_it_wrong(__FUNCTION__, sprintf(esc_html__('%1$s should not be called earlier the %2$s action.', 'advanced-dynamic-pricing-for-woocommerce'), 'load_requirements', 'plugins_loaded'), esc_html(WC_ADP_VERSION)); } $this->loadVoucher(); } private function loadVoucher() { if (function_exists('wc_pdf_product_vouchers')) { $this->voucher = wc_pdf_product_vouchers(); } } public function isActive() { return ! is_null($this->voucher); } }