Автор: Adam Piotrowski (adam@wellcommerce.org)
Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function getProductDefaultTemplateData(ProductInterface $product) : array
 {
     $shippingMethodCosts = $this->shippingMethodProvider->getCosts(new ProductContext($product));
     $variants = $this->variantHelper->getVariants($product);
     $attributes = $this->variantHelper->getAttributes($product);
     return ['product' => $product, 'shippingCosts' => $shippingMethodCosts, 'variants' => json_encode($variants), 'attributes' => $attributes];
 }
 private function refreshOrderProductVariantOptions(OrderProductInterface $orderProduct)
 {
     if ($orderProduct->hasVariant()) {
         $options = $this->variantHelper->getVariantOptions($orderProduct->getVariant());
         $orderProduct->setOptions($options);
     }
 }