php-shopify icon indicating copy to clipboard operation
php-shopify copied to clipboard

Update product price

Open Michaelrolle opened this issue 4 years ago • 2 comments

Is there a way to update the price of a product variant? I've tried multiple ways but nothing seems to work..

`$variantInfo = array( "variant" => array( "price" => "200" ) );

$variantId= 36418671050910; $shopify->Product->Variant($variantId)->put($variantInfo);`

I've also tried leaving out "variant" in $variantInfo and just using "price" as a key. Selecting one or both of Product/Variant doesn't work either. Any suggestions?

Thanks in advance!

Michaelrolle avatar Oct 02 '20 07:10 Michaelrolle

try using ProductVariant(). $variantInfo = array( "price" => "200" ); $shopify->ProductVariant($variantId)->put($pvariantInfo);

afnan125 avatar Feb 04 '22 06:02 afnan125