I have to update the price
and quantity
values of specific products
in a database.
As I understand, simply executing sql commands is not a great option since there are a lot of tables which have similar informations. I have read that Product()
object should be created.
How should I create the Product
object and then update it in the database?
You can check the class
ProductCore
inclasses/Product.php
for various methods and propertiesGenerally, you would write some code like this
Edit: To update the quantity you can use this method: