laravel-google-merchant-api
laravel-google-merchant-api copied to clipboard
product update
I didn't understand how to update a product. Would you please write an example to update a product availability in google merchant? Can it be something like :
$attributes = [
'id' => 1, // maps to offerId (if set in config)
'name' => 'Product 1', // likewise maps to title
];
$params = [
price =>[
'currency'=>'EUR' ,
'value'=>200
]
];
ProductApi::update(function($product) use($attributes){
$product->with($attributes)
->inStock($inStock = false);
}, $params )->then(function($data){
echo 'Product updated';
})->otherwise(function(){
echo 'Insert failed';
})->catch(function($e){
dump($e);
});