Automattic\WooCommerce\Internal\StockNotifications

Notification::get_product_permalink │ public │ WC 1.0

Get product link.

Method of the class: Notification{}

No Hooks.

Returns

string.

Usage

$Notification = new Notification();
$Notification->get_product_permalink();

Notification::get_product_permalink() code WC 11.3.0

public function get_product_permalink() {

	$product = $this->get_product();
	if ( ! $product || ! $product->get_id() ) {
		return '';
	}

	$posted_attributes = $this->get_meta( 'posted_attributes' );
	if ( ! $product instanceof \WC_Product_Variation || empty( $posted_attributes ) || ! is_array( $posted_attributes ) ) {
		return (string) $product->get_permalink();
	}

	return (string) $product->get_permalink( array( 'variation' => $this->get_variation_attributes_with_posted_data( $product ) ) );
}