Closed zerdmer closed 4 years ago
ok, i got it, but now:
$x=$client->getInventoryItemManager()->find($ProductVariantInventoryId); echo $x->getCost(); // get the cost echo $x->setCost(1.1); // doesn't work
even with $x->setCost("1.1") or $x->setCost("1,1") still doesn't work
THIS WORKS: $client->getInventoryItemManager()->update($ProductVariantInventoryId, [ "cost" => $NewCost ]); But the ->setCost should work, and it doesn't
@zerdmer
All models in the library are simple value objects. The design of the library does not assume that calling the setter will perform a request to the API and change the value on the side of Shopify. The correct way to update the value is to use the update method.
How get variant Cost?
$variant->getCost(); doesn't work, some idea? thanks!