Skip to content

[Backport] Sample Link Issue in Downloadable product in magento-2.2.6 #19344 #19431

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

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use Magento\Downloadable\Api\Data\SampleInterfaceFactory;
use Magento\Downloadable\Api\Data\LinkInterfaceFactory;

/**
* Class for initialization downloadable info from request.
*/
class Downloadable
{
/**
Expand Down Expand Up @@ -92,6 +95,8 @@ public function afterInitialize(
}
}
$extension->setDownloadableProductLinks($links);
} else {
$extension->setDownloadableProductLinks([]);
}
if (isset($downloadable['sample']) && is_array($downloadable['sample'])) {
$samples = [];
Expand All @@ -107,6 +112,8 @@ public function afterInitialize(
}
}
$extension->setDownloadableProductSamples($samples);
} else {
$extension->setDownloadableProductSamples([]);
}
$product->setExtensionAttributes($extension);
if ($product->getLinksPurchasedSeparately()) {
Expand Down