BSF_Update_Manager::get_purchse_key( string $product_id )

Get the prurchase key for product download API.


Description

If the product is bundeled then return it’s parent product purchase key.


Parameters

$product_id

(string) (Required) Product ID.


Return

(string) Purchase Key.


Source

File: admin/bsf-core/class-bsf-update-manager.php

		public function get_purchse_key( $product_id ) {
			$all_products = brainstorm_get_all_products();
			$is_bundled   = self::bsf_is_product_bundled( $product_id );
			$product      = isset( $all_products[ $product_id ] ) ? $all_products[ $product_id ] : array();

			if ( ! empty( $is_bundled ) ) {
				$product = isset( $all_products[ $product['parent'] ] ) ? $all_products[ $product['parent'] ] : array();
			}

			return isset( $product['purchase_key'] ) ? $product['purchase_key'] : '';
		}


User Contributed Notes

You must log in before being able to contribute a note or feedback.