diff --git a/src/Model/Resolver/Product/Links.php b/src/Model/Resolver/Product/Links.php new file mode 100644 index 0000000..00cc4ab --- /dev/null +++ b/src/Model/Resolver/Product/Links.php @@ -0,0 +1,66 @@ +pricingHelper = $pricingHelper; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if (!isset($value['model'])) { + throw new LocalizedException(__('"model" value should be specified')); + } + + /** @var Product $product */ + $product = $value['model']; + $data = parent::resolve($field, $context, $info, $value, $args); + + foreach ($data as &$link) { + $link['price'] = $this->pricingHelper->currencyByStore( + $link['price'], $product->getStore(), false + ); + } + + return $data; + } +} diff --git a/src/etc/di.xml b/src/etc/di.xml index 0330657..167217f 100755 --- a/src/etc/di.xml +++ b/src/etc/di.xml @@ -98,6 +98,9 @@ + +