public function create($productId, ProductVariant &$productVariant)
    {
        $data = $productVariant->exportData();
        $endpoint = '/admin/products/'.$productId.'/variants.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'variant' => $data
            )
        );
        $productVariant->setData($response['variant']);
    }
public function create($productId, ProductVariant &$productVariant)
    {
        $data = $productVariant->exportData();
        $endpoint = '/admin/products/'.$productId.'/variants.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'variant' => $data
            )
        );
        $productVariant->setData($response['variant']);
    }
public function create ( $ productId , ProductVariant & $ productVariant ) { $ data = $ productVariant -> exportData ( ) ; $ endpoint = '/admin/products/' . $ productId . '/variants.json' ; $ response = $ this -> request ( $ endpoint , 'POST' , array ( 'variant' => $ data ) ) ; $ productVariant -> setData ( $ response [ 'variant' ] ) ; }
Create a new product variant

@link   https://help.shopify.com/api/reference/product_variant#create
@param  integer        $productId
@param  ProductVariant $productVariant
@return void
Create a new product variant