Noptin_WooCommerce_Product_Purchase_Trigger::init_buy_trigger( string $product_id, array $item, int $order_id, int $subscriber_id, Noptin_WooCommerce $bridge )

Calls the trigger when a product is bought.

Parameters Parameters


(string) (Required) The product being bought.


(array) (Required) The order item being bought.


(int) (Required) The order being acted on.


(int) (Required) The subscriber for the order.


(Noptin_WooCommerce) (Required) The Noptin and WC integration bridge.

Top ↑

Source Source

File: includes/automation-rules/triggers/class-noptin-woocommerce-product-purchase-trigger.php

    public function init_buy_trigger( $product_id, $item, $order_id, $subscriber_id, $bridge ) {
        $details               = $bridge->get_order_details( $order_id );
        $details               = array_merge( $details, $item );
        $details['product_id'] = $product_id;
        $details['action']     = 'buy';
        $this->trigger( $subscriber_id, $details );

Top ↑

Changelog Changelog


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation