brainstrom_product_id_by_name( int $product_name )

Brainstorm product ID by name.


Description


Parameters

$product_name

(int) (Required) Product name.


Source

File: admin/bsf-core/index.php

	function brainstrom_product_id_by_name( $product_name ) {
		$product_id          = '';
		$brainstrom_products = get_option( 'brainstrom_products', array() );

		foreach ( $brainstrom_products as $key => $value ) {
			foreach ( $value as $key => $product ) {
				if ( isset( $product['product_name'] ) && strcasecmp( $product['product_name'], $product_name ) === 0 ) {
					$product_id = isset( $product['id'] ) ? $product['id'] : '';
				}
			}
		}

		return $product_id;
	}


User Contributed Notes

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