Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

Product update

Alexander Zaets edited this page Mar 12, 2018 · 1 revision
/* @var $product Product */
$product = Yii::$app->bluesnap->getProductModel(
    [
        'and',
        ['=', 'product_id', $productId]
    ]
);
if (!empty($product)) {
    $product = reset($product);
}
$product->product_name = $product->product_name." (last edit ".Yii::$app->formatter->asDatetime(time()).")";
if ($product->updateProduct()) {
    //product updated
} else {
    //product not updated
}