Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

product update #19

Open
dr-roshyara opened this issue Feb 22, 2023 · 0 comments
Open

product update #19

dr-roshyara opened this issue Feb 22, 2023 · 0 comments

Comments

@dr-roshyara
Copy link

dr-roshyara commented Feb 22, 2023

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);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant