Noptin_Abstract_Ecommerce_Integration::add_order_subscriber( int $order_id )

Adds/Updates an order subscriber.


Parameters Parameters

$order_id

(int) (Required) The order id.


Top ↑

Return Return

(int|null) The subscriber id.


Top ↑

Source Source

File: includes/integrations/class-noptin-abstract-ecommerce-integration.php

	public function add_order_subscriber( $order_id ) {

		// Fetch the subscriber id and order customer details.
		$subscriber_id      = $this->get_order_subscriber( $order_id );
		$subscriber_details = $this->get_order_customer_details( $order_id, empty( $subscriber_id ) );

		// Either create a new subscriber...
		if ( empty( $subscriber_id ) ) {

			// Should we process the subsriber?
			if ( ! $this->triggered( $order_id ) ) {
				return null;
			}

			return $this->add_subscriber( $subscriber_details, $order_id );
		}

		// Or update an existing one.
		return $this->update_subscriber( $subscriber_id, $subscriber_details, $order_id );

	}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.2.6Introduced.

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