|
|
|
|
|
|
|
|
if ($product->getTitle()) { |
|
|
if ($product->getTitle()) { |
|
|
$endOfTitle = $product->getTitle(); |
|
|
$endOfTitle = $product->getTitle(); |
|
|
} else { |
|
|
} else { |
|
|
$endOfTitle = $this->getQuantityInherited($product).' '.$this->getUnitInherited($product)->getWordingShort(); |
|
|
|
|
|
|
|
|
$endOfTitle = $this->getQuantityInherited($product) . ' ' . $this->getUnitInherited($product)->getWordingShort(); |
|
|
} |
|
|
} |
|
|
return $product->getProductFamily()->getTitle(). ' - '. $endOfTitle; |
|
|
|
|
|
|
|
|
return $product->getProductFamily()->getTitle() . ' - ' . $endOfTitle; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getQuantityInherited(ProductInterface $product) |
|
|
public function getQuantityInherited(ProductInterface $product) |
|
|
{ |
|
|
{ |
|
|
if ($product->getQuantity()) { |
|
|
if ($product->getQuantity()) { |
|
|
return $product->getQuantity(); |
|
|
return $product->getQuantity(); |
|
|
} else if($product->getProductFamily()->getQuantity()){ |
|
|
|
|
|
|
|
|
} else if ($product->getProductFamily()->getQuantity()) { |
|
|
return $product->getProductFamily()->getQuantity(); |
|
|
return $product->getProductFamily()->getQuantity(); |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getWeightInherited(ProductInterface $product): ? float |
|
|
|
|
|
{ |
|
|
|
|
|
if ($product->getWeight()) { |
|
|
|
|
|
return $product->getWeight(); |
|
|
|
|
|
} |
|
|
|
|
|
return $product->getProductFamily()->getWeight(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |