WC_Product_CSV_Exporter::get_column_value_parent_id( WC_Product $product )

Get parent_id value.


Description Description


Parameters Parameters

$product

(Required) Product being exported.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/export/class-wc-product-csv-exporter.php

	protected function get_column_value_parent_id( $product ) {
		if ( $product->get_parent_id( 'edit' ) ) {
			$parent = wc_get_product( $product->get_parent_id( 'edit' ) );
			if ( ! $parent ) {
				return '';
			}

			return $parent->get_sku( 'edit' ) ? $parent->get_sku( 'edit' ) : 'id:' . $parent->get_id();
		}
		return '';
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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