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

$product_id

(string) (Required) The product being bought.

$item

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

$order_id

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

$subscriber_id

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

$bridge

(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

Changelog
VersionDescription
1.3.0Introduced.

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