phpclassic / php-shopify

PHP SDK for Shopify API
Apache License 2.0
573 stars 210 forks source link

Update product price #182

Open Michaelrolle opened 4 years ago

Michaelrolle commented 4 years ago

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!

afnan125 commented 2 years ago

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

Ryunosukee commented 4 months ago

Thanks, its work for me !!

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