Skip to content

Commit

Permalink
patch-19344 : Fixed Sample Link Issue in Downloadable product magento…
Browse files Browse the repository at this point in the history
  • Loading branch information
ansari-ziyaurrahman committed Nov 28, 2018
1 parent 32a7c4b commit eed8485
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit eed8485

Please sign in to comment.