WC_AJAX::create_all_product_variations
Create all product variations from existing attributes.
Method of the class: WC_AJAX{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_AJAX::create_all_product_variations( $product );
- $product(mixed) (required)
- Product class.
WC_AJAX::create_all_product_variations() WC AJAX::create all product variations code WC 10.8.1
private static function create_all_product_variations( $product ) {
$data_store = $product->get_data_store();
if ( ! is_callable( array( $data_store, 'create_all_product_variations' ) ) ) {
wp_die();
}
$number = $data_store->create_all_product_variations( $product, Constants::get_constant( 'WC_MAX_LINKED_VARIATIONS' ) );
$data_store->sort_all_product_variations( $product->get_id() );
return $number;
}