added an error for variation using variation for parent in import and removed @access on 87

This commit is contained in:
Nicolas Bovee 2018-11-04 23:34:17 -07:00
parent b0b3ddccb0
commit fe5f2d411b
1 changed files with 5 additions and 0 deletions

View File

@ -434,6 +434,11 @@ abstract class WC_Product_Importer implements WC_Importer_Interface {
return new WP_Error( 'woocommerce_product_importer_missing_variation_parent_id', __( 'Variation cannot be imported: Missing parent ID or parent does not exist yet.', 'woocommerce' ), array( 'status' => 401 ) );
}
// Stop if parent is a product variation.
if ( $parent->post_type === 'product_variation' ) {
return new WP_Error( 'woocommerce_product_importer_parent_set_as_variation', __( 'Variation cannot be imported: Parent cannot be a product variation', 'woocommerce' ), array( 'status' => 401 ) );
}
if ( isset( $data['raw_attributes'] ) ) {
$attributes = array();
$parent_attributes = $this->get_variation_parent_attributes( $data['raw_attributes'], $parent );