I have set catalog price scope as Website in my store configuration to add different prices for different websites.
Now I am creating products using script which contains price data per website, but I am not able to store different prices for different websites scopes.
I am using below code. Using Reference
$product // << My Product Object
$availableWebsites // << Available Websites for product
foreach($availableWebsites as $websiteId){
foreach($attributesDataArray as $storeId => $storeData){ // Loop through all available Stores
$product->setStoreId($storeId);
$product->setPrice($price); // Set My price. Different for each website
try{
$product->save();
}catch(\Exception $e){
throw new \Exception($e->getMessage());
}
}
}
But the price is stored the same for each website scope. Any help is appreciated. Thanks.
websiteId
to match with store website which code is not related to the issue.