settings = woo_feed_get_options( 'all' ); if ( $this->is_active() ) { add_action( 'wp_enqueue_scripts', [ &$this, 'frontend_script' ] ); } } /** * Decides which event to trigger * * @return void * @since 4.4.34 */ public function trigger_event() { $event = 'page_view'; if ( is_product() && isset($_POST['add-to-cart']) ) { $event = 'product_view'; $add_to_cart = sanitize_text_field( $_POST['add-to-cart'] ); if ( ! empty($add_to_cart) ) { $event = 'add_to_cart'; } } elseif ( is_wc_endpoint_url('order-received') ) { $event = 'order_received'; } elseif (is_cart()){ $event = 'add_to_cart_list'; } elseif ( is_checkout() ) { $event = 'initiate_checkout'; } if ( method_exists( get_class($this), $event ) ) { $this->$event(); } } }