Browse Source

Ajout d'un fullTitle a product

packProduct
Fab 2 years ago
parent
commit
ef44c390ec
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      Solver/Product/ProductSolver.php

+ 10
- 0
Solver/Product/ProductSolver.php View File

@@ -126,6 +126,16 @@ class ProductSolver
}
}

public function getFullTitle(ProductInterface $product)
{
if ($product->getTitle()) {
$endOfTitle = $product->getTitle();
} else {
$endOfTitle = $this->getQuantityInherited($product).' '.$this->getUnitInherited($product)->getWordingShort();
}
return $product->getProductFamily()->getTitle(). ' - '. $endOfTitle;
}

public function getQuantityInherited(ProductInterface $product)
{
if ($product->getQuantity()) {

Loading…
Cancel
Save