Ejemplo n.º 1
0
 /**
  * Implementation of product specify logic of which product needs to be assigned to option.
  * For example if product which was added to option already removed from catalog.
  *
  * @param  \Magento\Catalog\Model\Product|null $optionProduct
  * @param  \Magento\Quote\Model\Quote\Item\Option $option
  * @param  \Magento\Catalog\Model\Product|null $product
  * @return $this
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function assignProductToOption($optionProduct, $option, $product)
 {
     if ($optionProduct) {
         $option->setProduct($optionProduct);
     } else {
         $option->getItem()->setHasConfigurationUnavailableError(true);
     }
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Implementation of product specify logic of which product needs to be assigned to option.
  * For example if product which was added to option already removed from catalog.
  *
  * @param \Magento\Catalog\Model\Product $optionProduct
  * @param \Magento\Quote\Model\Quote\Item\Option $option
  * @param \Magento\Catalog\Model\Product $product
  * @return $this
  */
 public function assignProductToOption($optionProduct, $option, $product)
 {
     if ($optionProduct) {
         $option->setProduct($optionProduct);
     } else {
         $option->setProduct($product);
     }
     return $this;
 }